diff --git a/Misc/python-mode.el b/Misc/python-mode.el index b0f0ab64f8a..20c5c2ccd02 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -891,6 +891,8 @@ of the first definition found." (setq def-name (buffer-substring-no-properties (match-beginning cur-paren) (match-end cur-paren)))) + (save-match-data + (py-beginning-of-def-or-class)) (beginning-of-line) (setq cur-indent (current-indentation)))