]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid the error when computing top-level indentation.
authorSam Steingold <sds@gnu.org>
Wed, 4 Feb 2015 21:26:43 +0000 (16:26 -0500)
committerSam Steingold <sds@gnu.org>
Wed, 4 Feb 2015 21:26:43 +0000 (16:26 -0500)
* lisp/progmodes/python.el (python-indent-calculate-indentation):
Do not apply max to an empty list

lisp/ChangeLog
lisp/progmodes/python.el

index 9e473e216265a411f84f8fbec1e1040dbf04a6d1..5f6a9c8bc0b19494dc9a0f582609dd0d5f24993b 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-04  Sam Steingold  <sds@gnu.org>
+
+       * progmodes/python.el (python-indent-calculate-indentation): Avoid
+       the error when computing top-level indentation.
+
 2015-02-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/cl-generic.el (cl--generic-member-method): Fix paren typo.
index d340550a0174fd0ee75b17ec7740eaf13bf4dc1d..9bfafeb20cdc08f9c6b09d8989f830301d7a2cd7 100644 (file)
@@ -1068,7 +1068,9 @@ minimum."
          (levels (python-indent--calculate-levels indentation)))
     (if previous
         (python-indent--previous-level levels (current-indentation))
-      (apply #'max levels))))
+      (if levels
+          (apply #'max levels)
+        0))))
 
 (defun python-indent-line (&optional previous)
   "Internal implementation of `python-indent-line-function'.