]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
(py-beginning-of-def-or-class): Only move to match-beginning if the
authorBarry Warsaw <barry@python.org>
Tue, 27 Jul 1999 21:40:02 +0000 (21:40 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 27 Jul 1999 21:40:02 +0000 (21:40 +0000)
regex match actually succeeded!

Misc/python-mode.el

index d30c1b37bc219527413573edda1296eba248a611..643f2f232fa35f0da904b7119c6ad9ed1afebdb0 100644 (file)
@@ -2164,8 +2164,8 @@ To mark the current `def', see `\\[py-mark-def-or-class]'."
             (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)