]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/python.el (python-fill-paren): Don't inf-loop at EOB.
authorLeonardo Nobrega <leonobr@gmail.com>
Tue, 30 Sep 2014 23:00:57 +0000 (19:00 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 30 Sep 2014 23:00:57 +0000 (19:00 -0400)
Fixes: debbugs:18462
lisp/ChangeLog
lisp/progmodes/python.el

index 62d3ba4445c2f0e9bf3692a60650bdbf9d8ccf97..9ac4f6b1bf128125cfd0905af7651b1dddfb921d 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-30  Leonardo Nobrega  <leonobr@gmail.com>  (tiny change)
+
+       * progmodes/python.el (python-fill-paren): Don't inf-loop at EOB
+       (bug#18462).
+
 2014-09-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/package.el (package-check-signature): Default to nil if
index 740dfee5870320436b844c2c6b57694e45dbf916..d5126fa888144046686e2da25505cdce01e16b7a 100644 (file)
@@ -3107,7 +3107,8 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
                           (end-of-line)
                           (when (not (python-syntax-context 'paren))
                             (skip-syntax-backward "^)")))
-                        (while (python-syntax-context 'paren)
+                        (while (and (python-syntax-context 'paren)
+                                    (not (eobp)))
                           (goto-char (1+ (point-marker))))
                         (point-marker)))
     (let ((paragraph-start "\f\\|[ \t]*$")
@@ -3118,7 +3119,8 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
     (while (not (eobp))
       (forward-line 1)
       (python-indent-line)
-      (goto-char (line-end-position)))) t)
+      (goto-char (line-end-position))))
+  t)
 
 \f
 ;;; Skeletons