[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 1d02107: Shut up python-mode's indentation guesser
From: |
Daniel Colascione |
Subject: |
[Emacs-diffs] master 1d02107: Shut up python-mode's indentation guesser |
Date: |
Thu, 26 Mar 2015 20:46:18 +0000 |
branch: master
commit 1d02107dab6f844a7c537bb5e98aff4e5f061246
Author: Daniel Colascione <address@hidden>
Commit: Daniel Colascione <address@hidden>
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.
---
lisp/ChangeLog | 5 +++++
lisp/progmodes/python.el | 11 +++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 294bcfe..0cc7bc6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-26 Daniel Colascione <address@hidden>
+ * progmodes/python.el
+ (python-indent-guess-indent-offset-verbose): New defcustom.
+ (python-indent-guess-indent-offset): Use it.
+
2015-03-26 Stefan Monnier <address@hidden>
* 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 42272a9..67b44aa 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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 1d02107: Shut up python-mode's indentation guesser,
Daniel Colascione <=