aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorDaniel Colascione2015-03-26 13:44:45 -0700
committerDaniel Colascione2015-03-26 13:46:06 -0700
commit1d02107dab6f844a7c537bb5e98aff4e5f061246 (patch)
tree795245a3f37577579364e5ae9ccf7c6303890230 /lisp/progmodes/python.el
parent8fd527eb00a0ec1d8d7cf916204c3be3e79e27da (diff)
downloademacs-1d02107dab6f844a7c537bb5e98aff4e5f061246.tar.gz
emacs-1d02107dab6f844a7c537bb5e98aff4e5f061246.zip
Shut up python-mode's indentation guesser
* lisp/progmodes/python.el (python-indent-guess-indent-offset-verbose): New defcustom. (python-indent-guess-indent-offset): Use it.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 42272a9d558..67b44aa1bbe 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -696,6 +696,12 @@ It makes underscores and dots word constituent chars.")
696 :group 'python 696 :group 'python
697 :safe 'booleanp) 697 :safe 'booleanp)
698 698
699(defcustom python-indent-guess-indent-offset-verbose t
700 "Non-nil means to emit a warning when indentation guessing fails."
701 :type 'boolean
702 :group 'python
703 :safe' booleanp)
704
699(defcustom python-indent-trigger-commands 705(defcustom python-indent-trigger-commands
700 '(indent-for-tab-command yas-expand yas/expand) 706 '(indent-for-tab-command yas-expand yas/expand)
701 "Commands that might trigger a `python-indent-line' call." 707 "Commands that might trigger a `python-indent-line' call."
@@ -766,8 +772,9 @@ work on `python-indent-calculate-indentation' instead."
766 (current-indentation)))) 772 (current-indentation))))
767 (if (and indentation (not (zerop indentation))) 773 (if (and indentation (not (zerop indentation)))
768 (set (make-local-variable 'python-indent-offset) indentation) 774 (set (make-local-variable 'python-indent-offset) indentation)
769 (message "Can't guess python-indent-offset, using defaults: %s" 775 (when python-indent-guess-indent-offset-verbose
770 python-indent-offset))))))) 776 (message "Can't guess python-indent-offset, using defaults: %s"
777 python-indent-offset))))))))
771 778
772(defun python-indent-context () 779(defun python-indent-context ()
773 "Get information about the current indentation context. 780 "Get information about the current indentation context.