aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2012-12-29 09:33:33 -0300
committerFabián Ezequiel Gallina2012-12-29 09:33:33 -0300
commit16768034b209fe12a6408866ac31688604b97375 (patch)
tree0ba118bf82d5ee3ca09ee9545dcb493e155b86cd /lisp/progmodes/python.el
parent66164d2f176b3f86ee5551b78f705d0fe776c611 (diff)
downloademacs-16768034b209fe12a6408866ac31688604b97375.tar.gz
emacs-16768034b209fe12a6408866ac31688604b97375.zip
* progmodes/python.el (python-shell-send-region): Add blank lines
for non sent code so backtraces remain correct.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 56a971f0c67..a427e95c037 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2008,7 +2008,14 @@ Returns the output. See `python-shell-send-string-no-output'."
2008(defun python-shell-send-region (start end) 2008(defun python-shell-send-region (start end)
2009 "Send the region delimited by START and END to inferior Python process." 2009 "Send the region delimited by START and END to inferior Python process."
2010 (interactive "r") 2010 (interactive "r")
2011 (python-shell-send-string (buffer-substring start end) nil t)) 2011 (python-shell-send-string
2012 (concat
2013 (let ((line-num (line-number-at-pos start)))
2014 ;; When sending a region, add blank lines for non sent code so
2015 ;; backtraces remain correct.
2016 (make-string (1- line-num) ?\n))
2017 (buffer-substring start end))
2018 nil t))
2012 2019
2013(defun python-shell-send-buffer (&optional arg) 2020(defun python-shell-send-buffer (&optional arg)
2014 "Send the entire buffer to inferior Python process. 2021 "Send the entire buffer to inferior Python process.