[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 04a32fa: * lisp/comint.el: Clean up namespace
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] master 04a32fa: * lisp/comint.el: Clean up namespace |
Date: |
Wed, 18 Jul 2018 10:23:27 -0400 (EDT) |
branch: master
commit 04a32fa60bead4359bc9353af67f26958c795593
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* 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.
---
doc/emacs/misc.texi | 4 ++--
doc/misc/efaq.texi | 4 ++--
etc/NEWS | 4 ++++
lisp/comint.el | 19 ++++++++++---------
lisp/net/rlogin.el | 8 ++++----
lisp/shell.el | 4 ++--
6 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 3d34414..236cb07 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
Ask the shell for its working directory, and update the Shell buffer's
default directory. @xref{Directory Tracking}.
address@hidden M-x send-invisible @key{RET} @var{text} @key{RET}
address@hidden send-invisible
address@hidden M-x comint-send-invisible @key{RET} @var{text} @key{RET}
address@hidden comint-send-invisible
Send @var{text} as input to the shell, after reading it without
echoing. This is useful when a shell command runs a program that asks
for a password.
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 903c56c..5b432d5 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.
@cindex Shell buffer, echoed commands and @samp{^M} in
@cindex Echoed commands in @code{shell-mode}
-Try typing @kbd{M-x shell-strip-ctrl-m @key{RET}} while in @code{shell-mode} to
+Try typing @kbd{M-x comint-strip-ctrl-m @key{RET}} while in @code{shell-mode}
to
make them go away. If that doesn't work, you have several options:
For @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
file:
@smalllisp
-(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m)
+(add-hook 'comint-output-filter-functions #'comint-strip-ctrl-m)
@end smalllisp
On a related note: if your shell is echoing your input line in the shell
diff --git a/etc/NEWS b/etc/NEWS
index 5648dd0..861520b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -233,6 +233,10 @@ shown in the currently selected window.
** Comint
+++
+*** 'send-invisible' is now an obsolete alias for `comint-send-invisible'
+Also, 'shell-strip-ctrl-m' is declared obsolete.
+
++++
*** 'C-c .' (comint-insert-previous-argument) no longer interprets '&'.
This feature caused problems when '&&' was present in the previous
command. Since this command emulates 'M-.' in Bash and zsh, neither
diff --git a/lisp/comint.el b/lisp/comint.el
index 71a2b5e..a9c3e47 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -78,7 +78,7 @@
;;
;; Not bound by default in comint-mode (some are in shell mode)
;; comint-run Run a program under comint-mode
-;; send-invisible Read a line w/o echo, and send to proc
+;; comint-send-invisible Read a line w/o echo, and send to proc
;; comint-dynamic-complete-filename Complete filename at point.
;; comint-dynamic-list-filename-completions List completions in help buffer.
;; 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
Input ring expansion is controlled by the variable `comint-input-autoexpand',
and addition is controlled by the variable `comint-input-ignoredups'.
-Commands with no default key bindings include `send-invisible',
+Commands with no default key bindings include `comint-send-invisible',
`completion-at-point', `comint-dynamic-list-filename-completions', and
`comint-magic-space'.
@@ -2247,7 +2247,7 @@ This function could be on
`comint-output-filter-functions' or bound to a key."
(error nil))
(while (re-search-forward "\r+$" pmark t)
(replace-match "" t t)))))
-(defalias 'shell-strip-ctrl-m 'comint-strip-ctrl-m)
+(define-obsolete-function-alias 'shell-strip-ctrl-m #'comint-strip-ctrl-m
"27.1")
(defun comint-show-maximum-output ()
"Put the end of the buffer at the bottom of the window."
@@ -2357,9 +2357,9 @@ a buffer local variable."
;; These three functions are for entering text you don't want echoed or
;; saved -- typically passwords to ftp, telnet, or somesuch.
-;; Just enter m-x send-invisible and type in your line.
+;; Just enter m-x comint-send-invisible and type in your line.
-(defun send-invisible (&optional prompt)
+(defun comint-send-invisible (&optional prompt)
"Read a string without echoing.
Then send it to the process running in the current buffer.
The string is sent using `comint-input-sender'.
@@ -2382,18 +2382,19 @@ Security bug: your string can still be temporarily
recovered with
(message "Warning: text will be echoed")))
(error "Buffer %s has no process" (current-buffer)))))
+(define-obsolete-function-alias 'send-invisible #'comint-send-invisible "27.1")
+
(defun comint-watch-for-password-prompt (string)
"Prompt in the minibuffer for password and send without echoing.
-This function uses `send-invisible' to read and send a password to the buffer's
-process if STRING contains a password prompt defined by
-`comint-password-prompt-regexp'.
+Looks for a match to `comint-password-prompt-regexp' in order
+to detect the need to (prompt and) send a password.
This function could be in the list `comint-output-filter-functions'."
(when (let ((case-fold-search t))
(string-match comint-password-prompt-regexp string))
(when (string-match "^[ \n\r\t\v\f\b\a]+" string)
(setq string (replace-match "" t t string)))
- (send-invisible string)))
+ (comint-send-invisible string)))
;; Low-level process communication
diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index 3bfc4d7..015e04f 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -1,4 +1,4 @@
-;;; rlogin.el --- remote login interface
+;;; rlogin.el --- remote login interface -*- lexical-binding:t -*-
;; Copyright (C) 1992-1995, 1997-1998, 2001-2018 Free Software
;; Foundation, Inc.
@@ -30,9 +30,9 @@
;; tracking and the sending of some special characters.
;; If you wish for rlogin mode to prompt you in the minibuffer for
-;; passwords when a password prompt appears, just enter m-x send-invisible
-;; and type in your line, or add `comint-watch-for-password-prompt' to
-;; `comint-output-filter-functions'.
+;; passwords when a password prompt appears, just enter
+;; M-x comint-send-invisible and type in your line (or tweak
+;; `comint-password-prompt-regexp' to match your password prompt).
;;; Code:
diff --git a/lisp/shell.el b/lisp/shell.el
index fa6eee0..ac6f11a 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -73,7 +73,7 @@
;; c-c c-o comint-delete-output Delete last batch of process
output
;; c-c c-r comint-show-output Show last batch of process output
;; c-c c-l comint-dynamic-list-input-ring List input history
-;; send-invisible Read line w/o echo & send to proc
+;; comint-send-invisible Read line w/o echo & send to proc
;; comint-continue-subjob Useful if you accidentally suspend
;; top-level job
;; comint-mode-hook is the comint mode hook.
@@ -500,7 +500,7 @@ Shell buffers. It implements `shell-completion-execonly'
for
the end of process to the end of the current line.
\\[comint-send-input] before end of process output copies the current line
minus the prompt to
the end of the buffer and sends it (\\[comint-copy-old-input] just copies
the current line).
-\\[send-invisible] reads a line of text without echoing it, and sends it to
+\\[comint-send-invisible] reads a line of text without echoing it, and sends
it to
the shell. This is useful for entering passwords. Or, add the function
`comint-watch-for-password-prompt' to `comint-output-filter-functions'.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 04a32fa: * lisp/comint.el: Clean up namespace,
Stefan Monnier <=