mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* progmodes/python.el (python-shell-send-region): Add blank lines
for non sent code so backtraces remain correct.
This commit is contained in:
parent
66164d2f17
commit
16768034b2
2 changed files with 13 additions and 1 deletions
|
|
@ -2008,7 +2008,14 @@ Returns the output. See `python-shell-send-string-no-output'."
|
|||
(defun python-shell-send-region (start end)
|
||||
"Send the region delimited by START and END to inferior Python process."
|
||||
(interactive "r")
|
||||
(python-shell-send-string (buffer-substring start end) nil t))
|
||||
(python-shell-send-string
|
||||
(concat
|
||||
(let ((line-num (line-number-at-pos start)))
|
||||
;; When sending a region, add blank lines for non sent code so
|
||||
;; backtraces remain correct.
|
||||
(make-string (1- line-num) ?\n))
|
||||
(buffer-substring start end))
|
||||
nil t))
|
||||
|
||||
(defun python-shell-send-buffer (&optional arg)
|
||||
"Send the entire buffer to inferior Python process.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue