emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 4188e3c: Avoid the error when computing top-level i


From: Sam Steingold
Subject: [Emacs-diffs] master 4188e3c: Avoid the error when computing top-level indentation.
Date: Wed, 04 Feb 2015 21:26:50 +0000

branch: master
commit 4188e3cc2bc69e75d4387b369e72e89fecc46a86
Author: Sam Steingold <address@hidden>
Commit: Sam Steingold <address@hidden>

    Avoid the error when computing top-level indentation.
    
    * lisp/progmodes/python.el (python-indent-calculate-indentation):
    Do not apply max to an empty list
---
 lisp/ChangeLog           |    5 +++++
 lisp/progmodes/python.el |    4 +++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9e473e2..5f6a9c8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-04  Sam Steingold  <address@hidden>
+
+       * progmodes/python.el (python-indent-calculate-indentation): Avoid
+       the error when computing top-level indentation.
+
 2015-02-04  Stefan Monnier  <address@hidden>
 
        * 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 d340550..9bfafeb 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -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'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]