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.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 4654143a160..1279c38b68b 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1052,16 +1052,19 @@ negative do the same but backwards. When NODECORATORS is non-nil
1052decorators are not included. Return non-nil if point is moved to the 1052decorators are not included. Return non-nil if point is moved to the
1053`beginning-of-defun'." 1053`beginning-of-defun'."
1054 (when (or (null arg) (= arg 0)) (setq arg 1)) 1054 (when (or (null arg) (= arg 0)) (setq arg 1))
1055 (if (> arg 0) 1055 (cond ((and (eq this-command 'mark-defun)
1056 (dotimes (i arg (python-nav-beginning-of-defun nodecorators))) 1056 (looking-at python-nav-beginning-of-defun-regexp)))
1057 (let ((found)) 1057 ((> arg 0)
1058 (dotimes (i (- arg) found) 1058 (dotimes (i arg (python-nav-beginning-of-defun nodecorators))))
1059 (python-end-of-defun-function) 1059 (t
1060 (python-util-forward-comment) 1060 (let ((found))
1061 (goto-char (line-end-position)) 1061 (dotimes (i (- arg) found)
1062 (when (not (eobp)) 1062 (python-end-of-defun-function)
1063 (setq found 1063 (python-util-forward-comment)
1064 (python-nav-beginning-of-defun nodecorators))))))) 1064 (goto-char (line-end-position))
1065 (when (not (eobp))
1066 (setq found
1067 (python-nav-beginning-of-defun nodecorators))))))))
1065 1068
1066(defun python-end-of-defun-function () 1069(defun python-end-of-defun-function ()
1067 "Move point to the end of def or class. 1070 "Move point to the end of def or class.