aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2015-02-04 16:26:43 -0500
committerSam Steingold2015-02-04 16:26:43 -0500
commit4188e3cc2bc69e75d4387b369e72e89fecc46a86 (patch)
tree87c1b0ab6281d85167ef4fd60ed76961244f434a
parent8e010cf6e7486fae28ec6de80f098c793aee28f3 (diff)
downloademacs-4188e3cc2bc69e75d4387b369e72e89fecc46a86.tar.gz
emacs-4188e3cc2bc69e75d4387b369e72e89fecc46a86.zip
Avoid the error when computing top-level indentation.
* lisp/progmodes/python.el (python-indent-calculate-indentation): Do not apply max to an empty list
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/python.el4
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9e473e21626..5f6a9c8bc0b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12015-02-04 Sam Steingold <sds@gnu.org>
2
3 * progmodes/python.el (python-indent-calculate-indentation): Avoid
4 the error when computing top-level indentation.
5
12015-02-04 Stefan Monnier <monnier@iro.umontreal.ca> 62015-02-04 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * emacs-lisp/cl-generic.el (cl--generic-member-method): Fix paren typo. 8 * emacs-lisp/cl-generic.el (cl--generic-member-method): Fix paren typo.
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index d340550a017..9bfafeb20cd 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1068,7 +1068,9 @@ minimum."
1068 (levels (python-indent--calculate-levels indentation))) 1068 (levels (python-indent--calculate-levels indentation)))
1069 (if previous 1069 (if previous
1070 (python-indent--previous-level levels (current-indentation)) 1070 (python-indent--previous-level levels (current-indentation))
1071 (apply #'max levels)))) 1071 (if levels
1072 (apply #'max levels)
1073 0))))
1072 1074
1073(defun python-indent-line (&optional previous) 1075(defun python-indent-line (&optional previous)
1074 "Internal implementation of `python-indent-line-function'. 1076 "Internal implementation of `python-indent-line-function'.