unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* bug/patch: python.el python-beginning-of-statement
@ 2004-06-27  9:34 Karl Chen
  2004-06-28  2:23 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Karl Chen @ 2004-06-27  9:34 UTC (permalink / raw)



BUG:
emacs -q /tmp/a.py
) RET TAB

If you have invalid syntax (such as unmatched ")") and try to
indent, python-mode will go into an infinite loop until you C-g.
The bug is in python-beginning-of-statement.


Index: python.el
===================================================================
--- python.el	(revision 6526)
+++ python.el	(working copy)
@@ -710,16 +710,17 @@
 expressions."
   (beginning-of-line)
   (python-beginning-of-string)
-  (while (python-continuation-line-p)
-    (beginning-of-line)
-    (if (python-backslash-continuation-line-p)
-	(while (python-backslash-continuation-line-p)
-	  (forward-line -1))
-      (python-beginning-of-string)
-      ;; Skip forward out of nested brackets.
-      (condition-case ()		; beware invalid syntax
-	  (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t)
-	(error (end-of-line)))))
+  (block nil
+    (while (python-continuation-line-p)
+      (beginning-of-line)
+      (if (python-backslash-continuation-line-p)
+          (while (python-backslash-continuation-line-p)
+            (forward-line -1))
+        (python-beginning-of-string)
+        ;; Skip forward out of nested brackets.
+        (condition-case ()		; beware invalid syntax
+            (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t)
+          (error (return))))))
   (back-to-indentation))
 
 (defun python-end-of-statement ()

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-06-28  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-27  9:34 bug/patch: python.el python-beginning-of-statement Karl Chen
2004-06-28  2:23 ` Richard Stallman
2004-06-28  8:33   ` Karl Chen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).