From ddc469679bb79e38605f6ad65c88c83a29def5ce Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 27 Jul 1999 21:40:02 +0000 Subject: [PATCH] (py-beginning-of-def-or-class): Only move to match-beginning if the regex match actually succeeded! --- Misc/python-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/python-mode.el b/Misc/python-mode.el index d30c1b37bc2..643f2f232fa 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)