aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/comint.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el27
1 files changed, 10 insertions, 17 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 93db4e24f2a..d5d95f8cbc0 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -213,7 +213,7 @@ This mirrors the optional behavior of tcsh (its autoexpand and histlist).
213If the value is `input', then the expansion is seen on input. 213If the value is `input', then the expansion is seen on input.
214If the value is `history', then the expansion is only when inserting 214If the value is `history', then the expansion is only when inserting
215into the buffer's input ring. See also `comint-magic-space' and 215into the buffer's input ring. See also `comint-magic-space' and
216`comint-dynamic-complete'. 216`completion-at-point'.
217 217
218This variable is buffer-local." 218This variable is buffer-local."
219 :type '(choice (const :tag "off" nil) 219 :type '(choice (const :tag "off" nil)
@@ -371,7 +371,7 @@ text matching `comint-prompt-regexp', depending on the value of
371 '(comint-c-a-p-replace-by-expanded-history comint-filename-completion) 371 '(comint-c-a-p-replace-by-expanded-history comint-filename-completion)
372 "List of functions called to perform completion. 372 "List of functions called to perform completion.
373Works like `completion-at-point-functions'. 373Works like `completion-at-point-functions'.
374See also `comint-dynamic-complete'. 374See also `completion-at-point'.
375 375
376This is a good thing to set in mode hooks.") 376This is a good thing to set in mode hooks.")
377 377
@@ -616,7 +616,7 @@ Input ring expansion is controlled by the variable `comint-input-autoexpand',
616and addition is controlled by the variable `comint-input-ignoredups'. 616and addition is controlled by the variable `comint-input-ignoredups'.
617 617
618Commands with no default key bindings include `send-invisible', 618Commands with no default key bindings include `send-invisible',
619`comint-dynamic-complete', `comint-dynamic-list-filename-completions', and 619`completion-at-point', `comint-dynamic-list-filename-completions', and
620`comint-magic-space'. 620`comint-magic-space'.
621 621
622Input to, and output from, the subprocess can cause the window to scroll to 622Input to, and output from, the subprocess can cause the window to scroll to
@@ -2892,7 +2892,7 @@ its response can be seen."
2892;; Useful completion functions, courtesy of the Ergo group. 2892;; Useful completion functions, courtesy of the Ergo group.
2893 2893
2894;; Six commands: 2894;; Six commands:
2895;; comint-dynamic-complete Complete or expand command, filename, 2895;; completion-at-point Complete or expand command, filename,
2896;; history at point. 2896;; history at point.
2897;; comint-dynamic-complete-filename Complete filename at point. 2897;; comint-dynamic-complete-filename Complete filename at point.
2898;; comint-dynamic-list-filename-completions List completions in help buffer. 2898;; comint-dynamic-list-filename-completions List completions in help buffer.
@@ -2901,7 +2901,7 @@ its response can be seen."
2901 2901
2902;; These are not installed in the comint-mode keymap. But they are 2902;; These are not installed in the comint-mode keymap. But they are
2903;; available for people who want them. Shell-mode installs them: 2903;; available for people who want them. Shell-mode installs them:
2904;; (define-key shell-mode-map "\t" 'comint-dynamic-complete) 2904;; (define-key shell-mode-map "\t" 'completion-at-point)
2905;; (define-key shell-mode-map "\M-?" 2905;; (define-key shell-mode-map "\M-?"
2906;; 'comint-dynamic-list-filename-completions))) 2906;; 'comint-dynamic-list-filename-completions)))
2907;; 2907;;
@@ -3491,11 +3491,6 @@ buffer. The idea is that this regular expression should match a prompt
3491string, and that there ought to be at least one copy of your prompt string 3491string, and that there ought to be at least one copy of your prompt string
3492in the process buffer already.") 3492in the process buffer already.")
3493 3493
3494(defvar comint-redirect-original-filter-function nil
3495 "The process filter that was in place when redirection is started.
3496When redirection is completed, the process filter is restored to
3497this value.")
3498
3499(defvar comint-redirect-subvert-readonly nil 3494(defvar comint-redirect-subvert-readonly nil
3500 "Non-nil means `comint-redirect' can insert into read-only buffers. 3495 "Non-nil means `comint-redirect' can insert into read-only buffers.
3501This works by binding `inhibit-read-only' around the insertion. 3496This works by binding `inhibit-read-only' around the insertion.
@@ -3558,8 +3553,8 @@ and does not normally need to be invoked by the end user or programmer."
3558 ;; Release the last redirected string 3553 ;; Release the last redirected string
3559 (setq comint-redirect-previous-input-string nil) 3554 (setq comint-redirect-previous-input-string nil)
3560 ;; Restore the process filter 3555 ;; Restore the process filter
3561 (set-process-filter (get-buffer-process (current-buffer)) 3556 (remove-function (process-filter (get-buffer-process (current-buffer)))
3562 comint-redirect-original-filter-function) 3557 #'comint-redirect-filter)
3563 ;; Restore the mode line 3558 ;; Restore the mode line
3564 (setq mode-line-process comint-redirect-original-mode-line-process) 3559 (setq mode-line-process comint-redirect-original-mode-line-process)
3565 ;; Set the completed flag 3560 ;; Set the completed flag
@@ -3701,10 +3696,8 @@ If NO-DISPLAY is non-nil, do not show the output buffer."
3701 comint-prompt-regexp ; Finished Regexp 3696 comint-prompt-regexp ; Finished Regexp
3702 echo) ; Echo input 3697 echo) ; Echo input
3703 3698
3704 ;; Set the filter 3699 ;; Set the filter.
3705 (setq comint-redirect-original-filter-function ; Save the old filter 3700 (add-function :override (process-filter proc) #'comint-redirect-filter)
3706 (process-filter proc))
3707 (set-process-filter proc 'comint-redirect-filter)
3708 3701
3709 ;; Send the command 3702 ;; Send the command
3710 (process-send-string (current-buffer) (concat command "\n")) 3703 (process-send-string (current-buffer) (concat command "\n"))
@@ -3812,7 +3805,7 @@ REGEXP-GROUP is the regular expression group in REGEXP to use."
3812;; (setq shell-mode-map (copy-keymap comint-mode-map)) 3805;; (setq shell-mode-map (copy-keymap comint-mode-map))
3813;; (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command) 3806;; (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command)
3814;; (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command) 3807;; (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command)
3815;; (define-key shell-mode-map "\t" 'comint-dynamic-complete) 3808;; (define-key shell-mode-map "\t" 'completion-at-point)
3816;; (define-key shell-mode-map "\M-?" 3809;; (define-key shell-mode-map "\M-?"
3817;; 'comint-dynamic-list-filename-completions))) 3810;; 'comint-dynamic-list-filename-completions)))
3818;; 3811;;