aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authornitishch2018-04-07 08:45:03 +0530
committerNoam Postavsky2018-04-08 12:36:00 -0400
commit5fb34352f6050ba225d14f2a51a6b99739826b1b (patch)
tree8d101e612c51ebdb6ebe98822934851f1b4962dc /lisp/progmodes/python.el
parent8df23a82042fa7dbaaa4377bc376d705595b073f (diff)
downloademacs-5fb34352f6050ba225d14f2a51a6b99739826b1b.tar.gz
emacs-5fb34352f6050ba225d14f2a51a6b99739826b1b.zip
Fix python-shell-send-defun at start of buffer (Bug#30822)
* lisp/progmodes/python.el (python-shell-send-defun): Handle the case when we hit the beginning of buffer. Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index afafd1b42cd..adf7b33ccbb 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3163,9 +3163,12 @@ t when called interactively."
3163 (beginning-of-line 1)) 3163 (beginning-of-line 1))
3164 (> (current-indentation) 0))) 3164 (> (current-indentation) 0)))
3165 (when (not arg) 3165 (when (not arg)
3166 (while (and (forward-line -1) 3166 (while (and
3167 (looking-at (python-rx decorator)))) 3167 (eq (forward-line -1) 0)
3168 (forward-line 1)) 3168 (if (looking-at (python-rx decorator))
3169 t
3170 (forward-line 1)
3171 nil))))
3169 (point-marker)) 3172 (point-marker))
3170 (progn 3173 (progn
3171 (or (python-nav-end-of-defun) 3174 (or (python-nav-end-of-defun)