aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 9adbb82abf4..c2483436fe9 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -359,7 +359,8 @@
359(defmacro python-rx (&rest regexps) 359(defmacro python-rx (&rest regexps)
360 "Python mode specialized rx macro. 360 "Python mode specialized rx macro.
361This variant of `rx' supports common Python named REGEXPS." 361This variant of `rx' supports common Python named REGEXPS."
362 `(rx-let ((block-start (seq symbol-start 362 `(rx-let ((sp-bsnl (or space (and ?\\ ?\n)))
363 (block-start (seq symbol-start
363 (or "def" "class" "if" "elif" "else" "try" 364 (or "def" "class" "if" "elif" "else" "try"
364 "except" "finally" "for" "while" "with" 365 "except" "finally" "for" "while" "with"
365 ;; Python 3.10+ PEP634 366 ;; Python 3.10+ PEP634
@@ -1439,7 +1440,7 @@ marks the next defun after the ones already marked."
1439 function)) 1440 function))
1440 1441
1441(defvar python-nav-beginning-of-defun-regexp 1442(defvar python-nav-beginning-of-defun-regexp
1442 (python-rx line-start (* space) defun (+ space) (group symbol-name)) 1443 (python-rx line-start (* space) defun (+ sp-bsnl) (group symbol-name))
1443 "Regexp matching class or function definition. 1444 "Regexp matching class or function definition.
1444The name of the defun should be grouped so it can be retrieved 1445The name of the defun should be grouped so it can be retrieved
1445via `match-string'.") 1446via `match-string'.")