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.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index dc9e091603b..0213a0ec8fb 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -870,6 +870,12 @@ With numeric ARG, just insert that many colons. With
870 870
871;;; Navigation 871;;; Navigation
872 872
873(defcustom python-use-beginning-of-innermost-defun nil
874 "Set if `beginning-of-defun-function' should go to innermost defun."
875 :type 'string
876 :group 'python
877 :safe 'stringp)
878
873(defvar python-beginning-of-defun-regexp 879(defvar python-beginning-of-defun-regexp
874 "^\\(def\\|class\\)[[:space:]]+[[:word:]]+" 880 "^\\(def\\|class\\)[[:space:]]+[[:word:]]+"
875 "Regular expresion matching beginning of outermost class or function.") 881 "Regular expresion matching beginning of outermost class or function.")
@@ -919,8 +925,17 @@ innermost definition."
919 nil)))) 925 nil))))
920 926
921(defun python-beginning-of-defun-function () 927(defun python-beginning-of-defun-function ()
928 "Move point to the beginning of \(inner|outer)most def or class.
929The point is moved to the beginning of innermost or outermost def
930or class given the value of
931`python-use-beginning-of-innermost-defun'. Returns nil if point
932is not in a def or class."
933 (python-beginning-of-defun python-use-beginning-of-innermost-defun))
934
935(defun python-beginning-of-outermost-defun ()
922 "Move point to the beginning of outermost def or class. 936 "Move point to the beginning of outermost def or class.
923Returns nil if point is not in a def or class." 937Returns nil if point is not in a def or class."
938 (interactive)
924 (python-beginning-of-defun nil)) 939 (python-beginning-of-defun nil))
925 940
926(defun python-beginning-of-innermost-defun () 941(defun python-beginning-of-innermost-defun ()