]> git.eshelyaron.com Git - emacs.git/commitdiff
(comint-redirect-send-command-to-process): Restore previous current buffer.
authorRichard M. Stallman <rms@gnu.org>
Fri, 18 Jan 2002 23:25:34 +0000 (23:25 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 18 Jan 2002 23:25:34 +0000 (23:25 +0000)
lisp/ChangeLog
lisp/comint.el

index ce6c0f23ee54011fc103211884408e2e35621269..4cf1aea044e6627bfdc7e08efd486c565a15fba7 100644 (file)
@@ -1,5 +1,8 @@
 2002-01-18  Richard M. Stallman  <rms@gnu.org>
 
+       * comint.el (comint-redirect-send-command-to-process):
+       Restore previous current buffer.
+
        * window.el (window-body-height): New function.
 
 2002-01-18  Zoltan Kemenczy  <kemenczy@rogers.com>
index 30a94ba71a8ba036d74b028ae57533c82d14f39c..c320334a8599e6732f59edc431e12f4b4a230fa7 100644 (file)
@@ -3164,52 +3164,52 @@ If NO-DISPLAY is non-nil, do not show the output buffer."
                           process))
         (proc (get-buffer-process process-buffer)))
     ;; Change to the process buffer
-    (set-buffer process-buffer)
+    (with-current-buffer process-buffer
 
-    ;; Make sure there's a prompt in the current process buffer
-    (and comint-redirect-perform-sanity-check
-        (save-excursion
-          (goto-char (point-max))
-          (or (re-search-backward comint-prompt-regexp nil t)
-              (error "No prompt found or `comint-prompt-regexp' not set properly"))))
+      ;; Make sure there's a prompt in the current process buffer
+      (and comint-redirect-perform-sanity-check
+          (save-excursion
+            (goto-char (point-max))
+            (or (re-search-backward comint-prompt-regexp nil t)
+                (error "No prompt found or `comint-prompt-regexp' not set properly"))))
 
     ;;;;;;;;;;;;;;;;;;;;;
-    ;; Set up for redirection
+      ;; Set up for redirection
     ;;;;;;;;;;;;;;;;;;;;;
-    (comint-redirect-setup
-     ;; Output Buffer
-     output-buffer
-     ;; Comint Buffer
-     (current-buffer)
-     ;; Finished Regexp
-     comint-prompt-regexp
-     ;; Echo input
-     echo)
+      (comint-redirect-setup
+       ;; Output Buffer
+       output-buffer
+       ;; Comint Buffer
+       (current-buffer)
+       ;; Finished Regexp
+       comint-prompt-regexp
+       ;; Echo input
+       echo)
 
     ;;;;;;;;;;;;;;;;;;;;;
-    ;; Set the filter
+      ;; Set the filter
     ;;;;;;;;;;;;;;;;;;;;;
-    ;; Save the old filter
-    (setq comint-redirect-original-filter-function
-         (process-filter proc))
-    (set-process-filter proc 'comint-redirect-filter)
+      ;; Save the old filter
+      (setq comint-redirect-original-filter-function
+           (process-filter proc))
+      (set-process-filter proc 'comint-redirect-filter)
 
     ;;;;;;;;;;;;;;;;;;;;;
-    ;; Send the command
+      ;; Send the command
     ;;;;;;;;;;;;;;;;;;;;;
-    (process-send-string
-     (current-buffer)
-     (concat command "\n"))
+      (process-send-string
+       (current-buffer)
+       (concat command "\n"))
 
     ;;;;;;;;;;;;;;;;;;;;;
-    ;; Show the output
+      ;; Show the output
     ;;;;;;;;;;;;;;;;;;;;;
-    (or no-display
-        (display-buffer
-         (get-buffer-create
-          (if (listp output-buffer)
-              (car output-buffer)
-            output-buffer))))))
+      (or no-display
+         (display-buffer
+          (get-buffer-create
+           (if (listp output-buffer)
+               (car output-buffer)
+             output-buffer)))))))
 
 ;;;###autoload
 (defun comint-redirect-results-list (command regexp regexp-group)