diff options
| author | Daniel Colascione | 2015-03-26 13:44:45 -0700 |
|---|---|---|
| committer | Daniel Colascione | 2015-03-26 13:46:06 -0700 |
| commit | 1d02107dab6f844a7c537bb5e98aff4e5f061246 (patch) | |
| tree | 795245a3f37577579364e5ae9ccf7c6303890230 | |
| parent | 8fd527eb00a0ec1d8d7cf916204c3be3e79e27da (diff) | |
| download | emacs-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.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 294bcfe7fb6..0cc7bc6f702 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2015-03-26 Daniel Colascione <dancol@dancol.org> | ||
| 2 | * progmodes/python.el | ||
| 3 | (python-indent-guess-indent-offset-verbose): New defcustom. | ||
| 4 | (python-indent-guess-indent-offset): Use it. | ||
| 5 | |||
| 1 | 2015-03-26 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2015-03-26 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * emacs-lisp/eieio.el (defclass): Change internal name so as to make | 8 | * 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.") | |||
| 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. |