changeset 430:5843408c9a38

modes: try and clean up python indentation a bit
author Augie Fackler <raf@durin42.com>
date Fri, 28 Apr 2017 14:52:18 -0400
parents 27e8ad5acedf
children 87a66e293d27
files .elisp/settings/40.modes.el
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/.elisp/settings/40.modes.el
+++ b/.elisp/settings/40.modes.el
@@ -61,9 +61,6 @@ point."
 (defun af-python-mode-hook ()
   ; highlight tabs in Python
   (make-variable-buffer-local 'font-lock-mode-hook)
-  (make-variable-buffer-local 'python-indent)
-  (if (and buffer-file-name (string-match "melange" buffer-file-name))
-     (set-variable 'python-indent 2))
   (af-tab-fix)
   (easy-menu-add-item nil '("Python") ["Run All Tests" nosetests-all t]
                       "Comment Out Region")
@@ -79,6 +76,8 @@ point."
   (local-set-key "\M-n" 'nosetests-module)
   (local-set-key "\M-\C-n" 'nosetests-one)
   (local-set-key (kbd "RET") 'comment-indent-new-line)
+  ; Match existing indentation in a file
+  (python-indent-guess-indent-offset)
 )
 (add-hook 'python-mode-hook 'af-python-mode-hook)