emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r111367: * progmodes/python.el (pytho


From: Fabián Ezequiel Gallina
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111367: * progmodes/python.el (python-shell-send-region): Add blank lines
Date: Sat, 29 Dec 2012 09:33:33 -0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111367
committer: Fabián Ezequiel Gallina <address@hidden>
branch nick: trunk
timestamp: Sat 2012-12-29 09:33:33 -0300
message:
  * progmodes/python.el (python-shell-send-region): Add blank lines
  for non sent code so backtraces remain correct.
modified:
  lisp/ChangeLog
  lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-12-29 11:04:55 +0000
+++ b/lisp/ChangeLog    2012-12-29 12:33:33 +0000
@@ -1,5 +1,10 @@
 2012-12-29  Fabián Ezequiel Gallina  <address@hidden>
 
+       * progmodes/python.el (python-shell-send-region): Add blank lines
+       for non sent code so backtraces remain correct.
+
+2012-12-29  Fabián Ezequiel Gallina  <address@hidden>
+
        * progmodes/python.el: Remove cl dependency.
        (python-syntax-count-quotes): Replace incf call.
        (python-fill-string): Replace setf call.

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2012-12-29 11:04:55 +0000
+++ b/lisp/progmodes/python.el  2012-12-29 12:33:33 +0000
@@ -2008,7 +2008,14 @@
 (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.


reply via email to

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