]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/python.el (python-indent-guess-indent-offset):
authorGlenn Morris <rgm@gnu.org>
Tue, 26 Nov 2013 03:15:49 +0000 (22:15 -0500)
committerGlenn Morris <rgm@gnu.org>
Tue, 26 Nov 2013 03:15:49 +0000 (22:15 -0500)
Avoid corner-case error.

Fixes: debbugs:15975
lisp/ChangeLog
lisp/progmodes/python.el

index fd41ed84d64dd83304dae2cad3ab3ea4e9e3a9e9..4e6442f89525de882d0ed12d7e2560b3df39076e 100644 (file)
@@ -1,5 +1,8 @@
 2013-11-26  Glenn Morris  <rgm@gnu.org>
 
+       * progmodes/python.el (python-indent-guess-indent-offset):
+       Avoid corner-case error.  (Bug#15975)
+
        Preload leim-list.el.  (Bug#4789)
        * loadup.el: Load leim-list.el when found.
        * startup.el (normal-top-level): Skip re-loading leim/leim-list.el.
index 8dc345ca1c1f30b3b9a446d2d37be455c66b79fc..458f0f16fb63cb1335a5ffecf37eeb0fb24a5ccc 100644 (file)
@@ -676,7 +676,7 @@ AFTER-LINE.")
                  (goto-char block-end)
                  (python-util-forward-comment)
                  (current-indentation))))
-          (if 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)))))))