diff Misc/python-mode.el @ 11144:41fcb40e841f legacy-trunk

(py-beginning-of-def-or-class): Only move to match-beginning if the regex match actually succeeded!
author Barry Warsaw <barry@python.org>
date Tue, 27 Jul 1999 21:40:02 +0000
parents a8a1eb99341c
children f62e465c4d01
line wrap: on
line diff
--- a/Misc/python-mode.el	Tue Jul 27 16:30:59 1999 +0000
+++ b/Misc/python-mode.el	Tue Jul 27 21:40:02 1999 +0000
@@ -2164,8 +2164,8 @@
 	     (zerop (current-column))
 	     (looking-at start-re))
 	(end-of-line))
-    (re-search-backward start-re nil 'move count)
-    (goto-char (match-beginning 0))))
+    (if (re-search-backward start-re nil 'move count)
+	(goto-char (match-beginning 0)))))
 
 ;; Backwards compatibility
 (defalias 'beginning-of-python-def-or-class 'py-beginning-of-def-or-class)