(py-beginning-of-def-or-class): Only move to match-beginning if the

regex match actually succeeded!
This commit is contained in:
Barry Warsaw 1999-07-27 21:40:02 +00:00
parent 4ef3ea0cc4
commit ddc469679b

View file

@ -2164,8 +2164,8 @@ To mark the current `def', see `\\[py-mark-def-or-class]'."
(zerop (current-column)) (zerop (current-column))
(looking-at start-re)) (looking-at start-re))
(end-of-line)) (end-of-line))
(re-search-backward start-re nil 'move count) (if (re-search-backward start-re nil 'move count)
(goto-char (match-beginning 0)))) (goto-char (match-beginning 0)))))
;; Backwards compatibility ;; Backwards compatibility
(defalias 'beginning-of-python-def-or-class 'py-beginning-of-def-or-class) (defalias 'beginning-of-python-def-or-class 'py-beginning-of-def-or-class)