aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2018-07-18 10:23:20 -0400
committerStefan Monnier2018-07-18 10:23:20 -0400
commit04a32fa60bead4359bc9353af67f26958c795593 (patch)
tree4252eb9289456b71892afc059162f0a04930ab72
parent343b29381cc53d53b1a2c1fdfacf0f5c4761f505 (diff)
downloademacs-04a32fa60bead4359bc9353af67f26958c795593.tar.gz
emacs-04a32fa60bead4359bc9353af67f26958c795593.zip
* lisp/comint.el: Clean up namespace
(shell-strip-ctrl-m): Mark as obsolete. (comint-send-invisible): Rename from `send-invisible`. (send-invisible): Make it an obsolete alias. * lisp/net/rlogin.el: Adjust accordingly; Use lexical-binding. * lisp/shell.el: Adjust accordingly.
-rw-r--r--doc/emacs/misc.texi4
-rw-r--r--doc/misc/efaq.texi4
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/comint.el19
-rw-r--r--lisp/net/rlogin.el8
-rw-r--r--lisp/shell.el4
6 files changed, 24 insertions, 19 deletions
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 3d3441401dd..236cb07785c 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -1026,8 +1026,8 @@ Move backward across one shell command, but not beyond the current line
1026Ask the shell for its working directory, and update the Shell buffer's 1026Ask the shell for its working directory, and update the Shell buffer's
1027default directory. @xref{Directory Tracking}. 1027default directory. @xref{Directory Tracking}.
1028 1028
1029@item M-x send-invisible @key{RET} @var{text} @key{RET} 1029@item M-x comint-send-invisible @key{RET} @var{text} @key{RET}
1030@findex send-invisible 1030@findex comint-send-invisible
1031Send @var{text} as input to the shell, after reading it without 1031Send @var{text} as input to the shell, after reading it without
1032echoing. This is useful when a shell command runs a program that asks 1032echoing. This is useful when a shell command runs a program that asks
1033for a password. 1033for a password.
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 903c56cef90..5b432d5b2fb 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -2988,7 +2988,7 @@ Emacs compiled on a 64-bit machine can handle much larger buffers.
2988@cindex Shell buffer, echoed commands and @samp{^M} in 2988@cindex Shell buffer, echoed commands and @samp{^M} in
2989@cindex Echoed commands in @code{shell-mode} 2989@cindex Echoed commands in @code{shell-mode}
2990 2990
2991Try typing @kbd{M-x shell-strip-ctrl-m @key{RET}} while in @code{shell-mode} to 2991Try typing @kbd{M-x comint-strip-ctrl-m @key{RET}} while in @code{shell-mode} to
2992make them go away. If that doesn't work, you have several options: 2992make them go away. If that doesn't work, you have several options:
2993 2993
2994For @code{tcsh}, put this in your @file{.cshrc} (or @file{.tcshrc}) 2994For @code{tcsh}, put this in your @file{.cshrc} (or @file{.tcshrc})
@@ -3041,7 +3041,7 @@ characters from the buffer by adding this to your @file{.emacs} init
3041file: 3041file:
3042 3042
3043@smalllisp 3043@smalllisp
3044(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m) 3044(add-hook 'comint-output-filter-functions #'comint-strip-ctrl-m)
3045@end smalllisp 3045@end smalllisp
3046 3046
3047On a related note: if your shell is echoing your input line in the shell 3047On a related note: if your shell is echoing your input line in the shell
diff --git a/etc/NEWS b/etc/NEWS
index 5648dd0a63a..861520bd14b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -233,6 +233,10 @@ shown in the currently selected window.
233** Comint 233** Comint
234 234
235+++ 235+++
236*** 'send-invisible' is now an obsolete alias for `comint-send-invisible'
237Also, 'shell-strip-ctrl-m' is declared obsolete.
238
239+++
236*** 'C-c .' (comint-insert-previous-argument) no longer interprets '&'. 240*** 'C-c .' (comint-insert-previous-argument) no longer interprets '&'.
237This feature caused problems when '&&' was present in the previous 241This feature caused problems when '&&' was present in the previous
238command. Since this command emulates 'M-.' in Bash and zsh, neither 242command. Since this command emulates 'M-.' in Bash and zsh, neither
diff --git a/lisp/comint.el b/lisp/comint.el
index 71a2b5eca55..a9c3e47f88e 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -78,7 +78,7 @@
78;; 78;;
79;; Not bound by default in comint-mode (some are in shell mode) 79;; Not bound by default in comint-mode (some are in shell mode)
80;; comint-run Run a program under comint-mode 80;; comint-run Run a program under comint-mode
81;; send-invisible Read a line w/o echo, and send to proc 81;; comint-send-invisible Read a line w/o echo, and send to proc
82;; comint-dynamic-complete-filename Complete filename at point. 82;; comint-dynamic-complete-filename Complete filename at point.
83;; comint-dynamic-list-filename-completions List completions in help buffer. 83;; comint-dynamic-list-filename-completions List completions in help buffer.
84;; comint-replace-by-expanded-filename Expand and complete filename at point; 84;; comint-replace-by-expanded-filename Expand and complete filename at point;
@@ -632,7 +632,7 @@ Input ring history expansion can be achieved with the commands
632Input ring expansion is controlled by the variable `comint-input-autoexpand', 632Input ring expansion is controlled by the variable `comint-input-autoexpand',
633and addition is controlled by the variable `comint-input-ignoredups'. 633and addition is controlled by the variable `comint-input-ignoredups'.
634 634
635Commands with no default key bindings include `send-invisible', 635Commands with no default key bindings include `comint-send-invisible',
636`completion-at-point', `comint-dynamic-list-filename-completions', and 636`completion-at-point', `comint-dynamic-list-filename-completions', and
637`comint-magic-space'. 637`comint-magic-space'.
638 638
@@ -2247,7 +2247,7 @@ This function could be on `comint-output-filter-functions' or bound to a key."
2247 (error nil)) 2247 (error nil))
2248 (while (re-search-forward "\r+$" pmark t) 2248 (while (re-search-forward "\r+$" pmark t)
2249 (replace-match "" t t))))) 2249 (replace-match "" t t)))))
2250(defalias 'shell-strip-ctrl-m 'comint-strip-ctrl-m) 2250(define-obsolete-function-alias 'shell-strip-ctrl-m #'comint-strip-ctrl-m "27.1")
2251 2251
2252(defun comint-show-maximum-output () 2252(defun comint-show-maximum-output ()
2253 "Put the end of the buffer at the bottom of the window." 2253 "Put the end of the buffer at the bottom of the window."
@@ -2357,9 +2357,9 @@ a buffer local variable."
2357 2357
2358;; These three functions are for entering text you don't want echoed or 2358;; These three functions are for entering text you don't want echoed or
2359;; saved -- typically passwords to ftp, telnet, or somesuch. 2359;; saved -- typically passwords to ftp, telnet, or somesuch.
2360;; Just enter m-x send-invisible and type in your line. 2360;; Just enter m-x comint-send-invisible and type in your line.
2361 2361
2362(defun send-invisible (&optional prompt) 2362(defun comint-send-invisible (&optional prompt)
2363 "Read a string without echoing. 2363 "Read a string without echoing.
2364Then send it to the process running in the current buffer. 2364Then send it to the process running in the current buffer.
2365The string is sent using `comint-input-sender'. 2365The string is sent using `comint-input-sender'.
@@ -2382,18 +2382,19 @@ Security bug: your string can still be temporarily recovered with
2382 (message "Warning: text will be echoed"))) 2382 (message "Warning: text will be echoed")))
2383 (error "Buffer %s has no process" (current-buffer))))) 2383 (error "Buffer %s has no process" (current-buffer)))))
2384 2384
2385(define-obsolete-function-alias 'send-invisible #'comint-send-invisible "27.1")
2386
2385(defun comint-watch-for-password-prompt (string) 2387(defun comint-watch-for-password-prompt (string)
2386 "Prompt in the minibuffer for password and send without echoing. 2388 "Prompt in the minibuffer for password and send without echoing.
2387This function uses `send-invisible' to read and send a password to the buffer's 2389Looks for a match to `comint-password-prompt-regexp' in order
2388process if STRING contains a password prompt defined by 2390to detect the need to (prompt and) send a password.
2389`comint-password-prompt-regexp'.
2390 2391
2391This function could be in the list `comint-output-filter-functions'." 2392This function could be in the list `comint-output-filter-functions'."
2392 (when (let ((case-fold-search t)) 2393 (when (let ((case-fold-search t))
2393 (string-match comint-password-prompt-regexp string)) 2394 (string-match comint-password-prompt-regexp string))
2394 (when (string-match "^[ \n\r\t\v\f\b\a]+" string) 2395 (when (string-match "^[ \n\r\t\v\f\b\a]+" string)
2395 (setq string (replace-match "" t t string))) 2396 (setq string (replace-match "" t t string)))
2396 (send-invisible string))) 2397 (comint-send-invisible string)))
2397 2398
2398;; Low-level process communication 2399;; Low-level process communication
2399 2400
diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index 3bfc4d7f356..015e04f4075 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -1,4 +1,4 @@
1;;; rlogin.el --- remote login interface 1;;; rlogin.el --- remote login interface -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1992-1995, 1997-1998, 2001-2018 Free Software 3;; Copyright (C) 1992-1995, 1997-1998, 2001-2018 Free Software
4;; Foundation, Inc. 4;; Foundation, Inc.
@@ -30,9 +30,9 @@
30;; tracking and the sending of some special characters. 30;; tracking and the sending of some special characters.
31 31
32;; If you wish for rlogin mode to prompt you in the minibuffer for 32;; If you wish for rlogin mode to prompt you in the minibuffer for
33;; passwords when a password prompt appears, just enter m-x send-invisible 33;; passwords when a password prompt appears, just enter
34;; and type in your line, or add `comint-watch-for-password-prompt' to 34;; M-x comint-send-invisible and type in your line (or tweak
35;; `comint-output-filter-functions'. 35;; `comint-password-prompt-regexp' to match your password prompt).
36 36
37;;; Code: 37;;; Code:
38 38
diff --git a/lisp/shell.el b/lisp/shell.el
index fa6eee0f187..ac6f11aeb40 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -73,7 +73,7 @@
73;; c-c c-o comint-delete-output Delete last batch of process output 73;; c-c c-o comint-delete-output Delete last batch of process output
74;; c-c c-r comint-show-output Show last batch of process output 74;; c-c c-r comint-show-output Show last batch of process output
75;; c-c c-l comint-dynamic-list-input-ring List input history 75;; c-c c-l comint-dynamic-list-input-ring List input history
76;; send-invisible Read line w/o echo & send to proc 76;; comint-send-invisible Read line w/o echo & send to proc
77;; comint-continue-subjob Useful if you accidentally suspend 77;; comint-continue-subjob Useful if you accidentally suspend
78;; top-level job 78;; top-level job
79;; comint-mode-hook is the comint mode hook. 79;; comint-mode-hook is the comint mode hook.
@@ -500,7 +500,7 @@ Shell buffers. It implements `shell-completion-execonly' for
500 the end of process to the end of the current line. 500 the end of process to the end of the current line.
501\\[comint-send-input] before end of process output copies the current line minus the prompt to 501\\[comint-send-input] before end of process output copies the current line minus the prompt to
502 the end of the buffer and sends it (\\[comint-copy-old-input] just copies the current line). 502 the end of the buffer and sends it (\\[comint-copy-old-input] just copies the current line).
503\\[send-invisible] reads a line of text without echoing it, and sends it to 503\\[comint-send-invisible] reads a line of text without echoing it, and sends it to
504 the shell. This is useful for entering passwords. Or, add the function 504 the shell. This is useful for entering passwords. Or, add the function
505 `comint-watch-for-password-prompt' to `comint-output-filter-functions'. 505 `comint-watch-for-password-prompt' to `comint-output-filter-functions'.
506 506