emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 5fb3435: Fix python-shell-send-defun at start of bu


From: Noam Postavsky
Subject: [Emacs-diffs] master 5fb3435: Fix python-shell-send-defun at start of buffer (Bug#30822)
Date: Sun, 8 Apr 2018 12:43:38 -0400 (EDT)

branch: master
commit 5fb34352f6050ba225d14f2a51a6b99739826b1b
Author: nitishch <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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
---
 lisp/progmodes/python.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index afafd1b..adf7b33 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3163,9 +3163,12 @@ t when called interactively."
                        (beginning-of-line 1))
                    (> (current-indentation) 0)))
        (when (not arg)
-         (while (and (forward-line -1)
-                     (looking-at (python-rx decorator))))
-         (forward-line 1))
+         (while (and
+                 (eq (forward-line -1) 0)
+                 (if (looking-at (python-rx decorator))
+                     t
+                   (forward-line 1)
+                   nil))))
        (point-marker))
      (progn
        (or (python-nav-end-of-defun)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]