From 5eac0c026f56f6159d871ea92d869eef56bf66ff Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 11 Feb 2012 12:20:16 +0800 Subject: Fix infinite loop in python-end-of-statement http://debbugs.gnu.org/10788 --- lisp/progmodes/python.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 15d98ce48af..3ef872d26eb 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1004,9 +1004,10 @@ On a comment line, go to end of line." (error (goto-char pos) (end-of-line))))) ((python-skip-out t s)))) (end-of-line)) - (unless comment - (eq ?\\ (char-before)))) ; Line continued? - (end-of-line 2)) ; Try next line. + (and (not comment) + (not (eobp)) + (eq ?\\ (char-before)))) ; Line continued? + (end-of-line 2)) ; Try next line. (point)) (defun python-previous-statement (&optional count) -- cgit v1.2.1