From: Daniel Colascione Date: Thu, 26 Mar 2015 20:44:45 +0000 (-0700) Subject: Shut up python-mode's indentation guesser X-Git-Tag: emacs-25.0.90~2564^2~63 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1d02107dab6f844a7c537bb5e98aff4e5f061246;p=emacs.git 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 294bcfe7fb6..0cc7bc6f702 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-26 Daniel Colascione + * progmodes/python.el + (python-indent-guess-indent-offset-verbose): New defcustom. + (python-indent-guess-indent-offset): Use it. + 2015-03-26 Stefan Monnier * emacs-lisp/eieio.el (defclass): Change internal name so as to make 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.") :group 'python :safe 'booleanp) +(defcustom python-indent-guess-indent-offset-verbose t + "Non-nil means to emit a warning when indentation guessing fails." + :type 'boolean + :group 'python + :safe' booleanp) + (defcustom python-indent-trigger-commands '(indent-for-tab-command yas-expand yas/expand) "Commands that might trigger a `python-indent-line' call." @@ -766,8 +772,9 @@ work on `python-indent-calculate-indentation' instead." (current-indentation)))) (if (and indentation (not (zerop indentation))) (set (make-local-variable 'python-indent-offset) indentation) - (message "Can't guess python-indent-offset, using defaults: %s" - python-indent-offset))))))) + (when python-indent-guess-indent-offset-verbose + (message "Can't guess python-indent-offset, using defaults: %s" + python-indent-offset)))))))) (defun python-indent-context () "Get information about the current indentation context.