summaryrefslogtreecommitdiffstats
path: root/Misc/python-mode.el
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-07-27 21:40:02 (GMT)
committerBarry Warsaw <barry@python.org>1999-07-27 21:40:02 (GMT)
commitddc469679bb79e38605f6ad65c88c83a29def5ce (patch)
tree2c0cd7ced1f27efaa6a5b97a48e8cbbd15a398fc /Misc/python-mode.el
parent4ef3ea0cc4b71a664e69c9835eed30411ad15c1e (diff)
downloadcpython-ddc469679bb79e38605f6ad65c88c83a29def5ce.zip
cpython-ddc469679bb79e38605f6ad65c88c83a29def5ce.tar.gz
cpython-ddc469679bb79e38605f6ad65c88c83a29def5ce.tar.bz2
(py-beginning-of-def-or-class): Only move to match-beginning if the
regex match actually succeeded!
Diffstat (limited to 'Misc/python-mode.el')
-rw-r--r--Misc/python-mode.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index d30c1b3..643f2f2 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -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)