diff options
| author | Richard M. Stallman | 2002-01-18 23:25:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-01-18 23:25:34 +0000 |
| commit | 98bd0dd38cd4b7918b6476b0de91ad21adaeb6c5 (patch) | |
| tree | 709175c252837a058f3b3ab882d185ef4bcc96e3 | |
| parent | a1e3dda0c3f52fd3400cb032cefbde67af329fff (diff) | |
| download | emacs-98bd0dd38cd4b7918b6476b0de91ad21adaeb6c5.tar.gz emacs-98bd0dd38cd4b7918b6476b0de91ad21adaeb6c5.zip | |
(comint-redirect-send-command-to-process): Restore previous current buffer.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/comint.el | 66 |
2 files changed, 36 insertions, 33 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ce6c0f23ee5..4cf1aea044e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2002-01-18 Richard M. Stallman <rms@gnu.org> | 1 | 2002-01-18 Richard M. Stallman <rms@gnu.org> |
| 2 | 2 | ||
| 3 | * comint.el (comint-redirect-send-command-to-process): | ||
| 4 | Restore previous current buffer. | ||
| 5 | |||
| 3 | * window.el (window-body-height): New function. | 6 | * window.el (window-body-height): New function. |
| 4 | 7 | ||
| 5 | 2002-01-18 Zoltan Kemenczy <kemenczy@rogers.com> | 8 | 2002-01-18 Zoltan Kemenczy <kemenczy@rogers.com> |
diff --git a/lisp/comint.el b/lisp/comint.el index 30a94ba71a8..c320334a859 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -3164,52 +3164,52 @@ If NO-DISPLAY is non-nil, do not show the output buffer." | |||
| 3164 | process)) | 3164 | process)) |
| 3165 | (proc (get-buffer-process process-buffer))) | 3165 | (proc (get-buffer-process process-buffer))) |
| 3166 | ;; Change to the process buffer | 3166 | ;; Change to the process buffer |
| 3167 | (set-buffer process-buffer) | 3167 | (with-current-buffer process-buffer |
| 3168 | 3168 | ||
| 3169 | ;; Make sure there's a prompt in the current process buffer | 3169 | ;; Make sure there's a prompt in the current process buffer |
| 3170 | (and comint-redirect-perform-sanity-check | 3170 | (and comint-redirect-perform-sanity-check |
| 3171 | (save-excursion | 3171 | (save-excursion |
| 3172 | (goto-char (point-max)) | 3172 | (goto-char (point-max)) |
| 3173 | (or (re-search-backward comint-prompt-regexp nil t) | 3173 | (or (re-search-backward comint-prompt-regexp nil t) |
| 3174 | (error "No prompt found or `comint-prompt-regexp' not set properly")))) | 3174 | (error "No prompt found or `comint-prompt-regexp' not set properly")))) |
| 3175 | 3175 | ||
| 3176 | ;;;;;;;;;;;;;;;;;;;;; | 3176 | ;;;;;;;;;;;;;;;;;;;;; |
| 3177 | ;; Set up for redirection | 3177 | ;; Set up for redirection |
| 3178 | ;;;;;;;;;;;;;;;;;;;;; | 3178 | ;;;;;;;;;;;;;;;;;;;;; |
| 3179 | (comint-redirect-setup | 3179 | (comint-redirect-setup |
| 3180 | ;; Output Buffer | 3180 | ;; Output Buffer |
| 3181 | output-buffer | 3181 | output-buffer |
| 3182 | ;; Comint Buffer | 3182 | ;; Comint Buffer |
| 3183 | (current-buffer) | 3183 | (current-buffer) |
| 3184 | ;; Finished Regexp | 3184 | ;; Finished Regexp |
| 3185 | comint-prompt-regexp | 3185 | comint-prompt-regexp |
| 3186 | ;; Echo input | 3186 | ;; Echo input |
| 3187 | echo) | 3187 | echo) |
| 3188 | 3188 | ||
| 3189 | ;;;;;;;;;;;;;;;;;;;;; | 3189 | ;;;;;;;;;;;;;;;;;;;;; |
| 3190 | ;; Set the filter | 3190 | ;; Set the filter |
| 3191 | ;;;;;;;;;;;;;;;;;;;;; | 3191 | ;;;;;;;;;;;;;;;;;;;;; |
| 3192 | ;; Save the old filter | 3192 | ;; Save the old filter |
| 3193 | (setq comint-redirect-original-filter-function | 3193 | (setq comint-redirect-original-filter-function |
| 3194 | (process-filter proc)) | 3194 | (process-filter proc)) |
| 3195 | (set-process-filter proc 'comint-redirect-filter) | 3195 | (set-process-filter proc 'comint-redirect-filter) |
| 3196 | 3196 | ||
| 3197 | ;;;;;;;;;;;;;;;;;;;;; | 3197 | ;;;;;;;;;;;;;;;;;;;;; |
| 3198 | ;; Send the command | 3198 | ;; Send the command |
| 3199 | ;;;;;;;;;;;;;;;;;;;;; | 3199 | ;;;;;;;;;;;;;;;;;;;;; |
| 3200 | (process-send-string | 3200 | (process-send-string |
| 3201 | (current-buffer) | 3201 | (current-buffer) |
| 3202 | (concat command "\n")) | 3202 | (concat command "\n")) |
| 3203 | 3203 | ||
| 3204 | ;;;;;;;;;;;;;;;;;;;;; | 3204 | ;;;;;;;;;;;;;;;;;;;;; |
| 3205 | ;; Show the output | 3205 | ;; Show the output |
| 3206 | ;;;;;;;;;;;;;;;;;;;;; | 3206 | ;;;;;;;;;;;;;;;;;;;;; |
| 3207 | (or no-display | 3207 | (or no-display |
| 3208 | (display-buffer | 3208 | (display-buffer |
| 3209 | (get-buffer-create | 3209 | (get-buffer-create |
| 3210 | (if (listp output-buffer) | 3210 | (if (listp output-buffer) |
| 3211 | (car output-buffer) | 3211 | (car output-buffer) |
| 3212 | output-buffer)))))) | 3212 | output-buffer))))))) |
| 3213 | 3213 | ||
| 3214 | ;;;###autoload | 3214 | ;;;###autoload |
| 3215 | (defun comint-redirect-results-list (command regexp regexp-group) | 3215 | (defun comint-redirect-results-list (command regexp regexp-group) |