summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLeonardo Nobrega <leonobr@gmail.com>2014-09-30 19:00:57 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-09-30 19:00:57 -0400
commitd3b7a90bc2ad20192d1afd23eb1aa6a18ceda569 (patch)
treedd6b0d2e8e7829fd43db345c04f8c316bc256b76 /lisp
parent572fe798cd0a00ad4a9050a7962cf8e8fbcc209b (diff)
downloademacs-d3b7a90bc2ad20192d1afd23eb1aa6a18ceda569.tar.gz
* lisp/progmodes/python.el (python-fill-paren): Don't inf-loop at EOB.
Fixes: debbugs:18462
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/python.el6
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 62d3ba4445c..9ac4f6b1bf1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 740dfee5870..d5126fa8881 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -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)
;;; Skeletons