bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#30822: 25.3; python-shell-send-defun sends only one line


From: Noam Postavsky
Subject: bug#30822: 25.3; python-shell-send-defun sends only one line
Date: Wed, 14 Mar 2018 20:22:10 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

retitle 30822 python-shell-send-defun can't send first line of buffer
tags 30822 + confirmed
found 30822 26.1
severity 30822 minor
quit

David Liu <daveliu@alum.mit.edu> writes:

> regarding the possible bug with python-shell-send-defun, it seems to
> *only* occurs if the python function starts on the very first line of
> the file. Otherwise, python-shell-send-defun works perfectly.

Indeed, there is an unconditional call to `forward-line', which makes it
impossible to for python-shell-send-defun to send the first line of the
buffer:

(defun python-shell-send-defun (&optional arg msg)
  [...]
    (python-shell-send-region
     (progn
       (end-of-line 1)
       (while (and (or (python-nav-beginning-of-defun)
                       (beginning-of-line 1))
                   (> (current-indentation) 0)))
       (when (not arg)
         (while (and (forward-line -1)
                     (looking-at (python-rx decorator))))
         (forward-line 1)) ; <-----------------------------------
       (point-marker))
      [...]






reply via email to

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