diff .elisp/settings/40.modes.el @ 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 95621f473f7e
children 601884c45f8a
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)