emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Fabián Ezequiel Gallina
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109126: * progmodes/python.el (python-shell-send-string-no-output): Allow
Date: Tue, 17 Jul 2012 13:47:58 -0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109126
fixes bug: http://debbugs.gnu.org/11868
committer: Fabián Ezequiel Gallina <address@hidden>
branch nick: trunk
timestamp: Tue 2012-07-17 13:47:58 -0300
message:
  * progmodes/python.el (python-shell-send-string-no-output): Allow
  accept-process-output to quit, keeping shell process ready for
  future interactions.
modified:
  lisp/ChangeLog
  lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-07-17 12:58:25 +0000
+++ b/lisp/ChangeLog    2012-07-17 16:47:58 +0000
@@ -1,3 +1,9 @@
+2012-07-17  Fabián Ezequiel Gallina  <address@hidden>
+
+       * progmodes/python.el (python-shell-send-string-no-output): Allow
+       accept-process-output to quit, keeping shell process ready for
+       future interactions (Bug#11868).
+
 2012-07-17  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/cl-macs.el (cl-progv): Use a properly prefixed var name.

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2012-07-16 17:18:39 +0000
+++ b/lisp/progmodes/python.el  2012-07-17 16:47:58 +0000
@@ -1701,24 +1701,29 @@
   "Send STRING to PROCESS and inhibit output.
 When MSG is non-nil messages the first line of STRING.  Return
 the output."
-  (let* ((output-buffer)
+  (let* ((output-buffer "")
          (process (or process (python-shell-get-or-create-process)))
          (comint-preoutput-filter-functions
           (append comint-preoutput-filter-functions
                   '(ansi-color-filter-apply
                     (lambda (string)
                       (setq output-buffer (concat output-buffer string))
-                      "")))))
-    (python-shell-send-string string process msg)
-    (accept-process-output process)
-    (replace-regexp-in-string
-     (if (> (length python-shell-prompt-output-regexp) 0)
-         (format "\n*%s$\\|^%s\\|\n$"
-                 python-shell-prompt-regexp
-                 (or python-shell-prompt-output-regexp ""))
-       (format "\n*$\\|^%s\\|\n$"
-               python-shell-prompt-regexp))
-     "" output-buffer)))
+                      ""))))
+         (inhibit-quit t))
+    (or
+     (with-local-quit
+       (python-shell-send-string string process msg)
+       (accept-process-output process)
+       (replace-regexp-in-string
+        (if (> (length python-shell-prompt-output-regexp) 0)
+            (format "\n*%s$\\|^%s\\|\n$"
+                    python-shell-prompt-regexp
+                    (or python-shell-prompt-output-regexp ""))
+          (format "\n*$\\|^%s\\|\n$"
+                  python-shell-prompt-regexp))
+        "" output-buffer))
+     (with-current-buffer (process-buffer process)
+       (comint-interrupt-subjob)))))
 
 (defun python-shell-internal-send-string (string)
   "Send STRING to the Internal Python interpreter.


reply via email to

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