mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-29 19:48:19 +00:00
* comint.el (comint-redirect-previous-input-string): New variable.
(comint-redirect-setup, comint-redirect-cleanup) (comint-redirect-preoutput-filter): Use it. Fixes redirection bug. (comint-redirect-preoutput-filter): Fix verbose message.
This commit is contained in:
parent
1300288527
commit
fab6916d0c
@ -1,3 +1,10 @@
|
||||
2012-12-20 Michael R. Mauger <mmaug@yahoo.com>
|
||||
|
||||
* comint.el (comint-redirect-previous-input-string): New variable.
|
||||
(comint-redirect-setup, comint-redirect-cleanup)
|
||||
(comint-redirect-preoutput-filter): Use it. Fixes redirection bug.
|
||||
(comint-redirect-preoutput-filter): Fix verbose message.
|
||||
|
||||
2012-12-20 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* progmodes/grep.el (rgrep): Escape command line. Sometimes, it
|
||||
|
@ -3490,6 +3490,11 @@ This works by binding `inhibit-read-only' around the insertion.
|
||||
This is useful, for instance, for insertion into Help mode buffers.
|
||||
You probably want to set it locally to the output buffer.")
|
||||
|
||||
(defvar comint-redirect-previous-input-string nil
|
||||
"Last redirected line of text.
|
||||
Allows detection of the end of the redirection in case the
|
||||
completion string is split between two output segments.")
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Functions
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
@ -3527,6 +3532,9 @@ and does not normally need to be invoked by the end user or programmer."
|
||||
(make-local-variable 'comint-redirect-completed)
|
||||
(setq comint-redirect-completed nil)
|
||||
|
||||
(make-local-variable 'comint-redirect-previous-input-string)
|
||||
(setq comint-redirect-previous-input-string "")
|
||||
|
||||
(setq mode-line-process
|
||||
(if mode-line-process
|
||||
(list (concat (elt mode-line-process 0) " Redirection"))
|
||||
@ -3535,6 +3543,8 @@ and does not normally need to be invoked by the end user or programmer."
|
||||
(defun comint-redirect-cleanup ()
|
||||
"End a Comint redirection. See `comint-redirect-send-command'."
|
||||
(interactive)
|
||||
;; Release the last redirected string
|
||||
(setq comint-redirect-previous-input-string nil)
|
||||
;; Restore the process filter
|
||||
(set-process-filter (get-buffer-process (current-buffer))
|
||||
comint-redirect-original-filter-function)
|
||||
@ -3616,18 +3626,21 @@ This function does not need to be invoked by the end user."
|
||||
|
||||
;; Message
|
||||
(and comint-redirect-verbose
|
||||
(message "Redirected output to buffer(s) %s"
|
||||
(mapconcat 'identity output-buffer-list " ")))
|
||||
(message "Redirected output to buffer(s) %s" output-buffer-list))
|
||||
|
||||
;; If we see the prompt, tidy up
|
||||
;; We'll look for the prompt in the original string, so nobody can
|
||||
;; clobber it
|
||||
(and (string-match comint-redirect-finished-regexp input-string)
|
||||
(and (string-match comint-redirect-finished-regexp
|
||||
(concat comint-redirect-previous-input-string
|
||||
input-string))
|
||||
(progn
|
||||
(and comint-redirect-verbose
|
||||
(message "Redirection completed"))
|
||||
(comint-redirect-cleanup)
|
||||
(run-hooks 'comint-redirect-hook)))
|
||||
(setq comint-redirect-previous-input-string input-string)
|
||||
|
||||
;; Echo input?
|
||||
(if comint-redirect-echo-input
|
||||
filtered-input-string
|
||||
|
Loading…
Reference in New Issue
Block a user