]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/comint.el: Clean up namespace
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 18 Jul 2018 14:23:20 +0000 (10:23 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 18 Jul 2018 14:23:20 +0000 (10:23 -0400)
(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
doc/misc/efaq.texi
etc/NEWS
lisp/comint.el
lisp/net/rlogin.el
lisp/shell.el

index 3d3441401dde1b1890a955a6b9a3cecc6c35e70f..236cb07785c3aec074fbff1196cd99631fb69972 100644 (file)
@@ -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}.
 
-@item M-x send-invisible @key{RET} @var{text} @key{RET}
-@findex send-invisible
+@item M-x comint-send-invisible @key{RET} @var{text} @key{RET}
+@findex 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.
index 903c56cef90caa6d4f26c015b121b1070624688d..5b432d5b2fb9b026b424096b4af53be28919c12f 100644 (file)
@@ -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
index 5648dd0a63a7daa657f5c1a5f121a14c6e497fed..861520bd14ba905b20ca18898e46ee98fa1c99d7 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -232,6 +232,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
index 71a2b5eca55386690d1efffc3bbb4fae3f8d7751..a9c3e47f88e7548380f8c79cd792f7d03fb6c71a 100644 (file)
@@ -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)))
 \f
 ;; Low-level process communication
 
index 3bfc4d7f356f7cf0ecad705ca27cec990d2779ca..015e04f4075ac228a7cc2134124bbb8652c9f1f7 100644 (file)
@@ -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:
 
index fa6eee0f187671cc97ba6dd3a48e625d244f918b..ac6f11aeb401f1506508e488bd363878754b9908 100644 (file)
@@ -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'.