]> git.eshelyaron.com Git - emacs.git/commitdiff
Warn about read-passwd in batch mode
authorGlenn Morris <rgm@gnu.org>
Thu, 26 Jun 2014 19:00:42 +0000 (15:00 -0400)
committerGlenn Morris <rgm@gnu.org>
Thu, 26 Jun 2014 19:00:42 +0000 (15:00 -0400)
* doc/lispref/minibuf.texi (Intro to Minibuffers): Batch mode is basic.
(Reading a Password): Mention batch mode.

* lisp/subr.el (read-passwd): Warn about batch mode.

Fixes: debbugs:17839
doc/lispref/ChangeLog
doc/lispref/minibuf.texi
lisp/ChangeLog
lisp/subr.el

index 4610c33796a47ec10261a4b25831fe45ff6dcfaf..6b673e7f329352fc69883528acdabeb930e9b965 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-26  Glenn Morris  <rgm@gnu.org>
+
+       * minibuf.texi (Intro to Minibuffers): Batch mode is basic.
+       (Reading a Password): Mention batch mode.  (Bug#17839)
+
 2014-06-21  Eli Zaretskii  <eliz@gnu.org>
 
        * positions.texi (Screen Lines): Clarify how columns are counted
index 5b4e29c57a3d2842237fbae6fbb1abc3ff1e78e3..4a94f41d73275fcf5c4435da02b47c49699d896e 100644 (file)
@@ -101,7 +101,9 @@ the minibuffer is in a separate frame.  @xref{Minibuffers and Frames}.
 
   When Emacs is running in batch mode, any request to read from the
 minibuffer actually reads a line from the standard input descriptor that
-was supplied when Emacs was started.
+was supplied when Emacs was started.  This supports only basic input:
+none of the special minibuffer features (history, completion,
+password hiding, etc.) are available in batch mode.
 
 @node Text from Minibuffer
 @section Reading Text Strings with the Minibuffer
@@ -2123,7 +2125,8 @@ function @code{read-passwd}.
 @defun read-passwd prompt &optional confirm default
 This function reads a password, prompting with @var{prompt}.  It does
 not echo the password as the user types it; instead, it echoes @samp{.}
-for each character in the password.
+for each character in the password.  (Note that in batch mode, the
+input is not hidden.)
 
 The optional argument @var{confirm}, if non-@code{nil}, says to read the
 password twice and insist it must be the same both times.  If it isn't
index 6c8f118c8a3582e3d041bc63e459c92c0e291190..0cc5b7fe71cade0f0b5636312d861478bf5e2e0a 100644 (file)
@@ -1,3 +1,7 @@
+2014-06-26  Glenn Morris  <rgm@gnu.org>
+
+       * subr.el (read-passwd): Warn about batch mode.  (Bug#17839)
+
 2014-06-26  Daiki Ueno  <ueno@gnu.org>
 
        * emacs-lisp/package.el (package--check-signature):
index 700c072a81bbeadf1dd1d0c41c1690aba45eae26..ac0e130b4e087d0e712d1cf3733f3156caf9e4fa 100644 (file)
@@ -2006,6 +2006,7 @@ If optional CONFIRM is non-nil, read the password twice to make sure.
 Optional DEFAULT is a default password to use instead of empty input.
 
 This function echoes `.' for each character that the user types.
+Note that in batch mode, the input is not hidden!
 
 Once the caller uses the password, it can erase the password
 by doing (clear-string STRING)."
@@ -2045,7 +2046,11 @@ by doing (clear-string STRING)."
             (add-hook 'after-change-functions hide-chars-fun nil 'local))
         (unwind-protect
             (let ((enable-recursive-minibuffers t))
-              (read-string prompt nil t default)) ; t = "no history"
+              (read-string
+               (if noninteractive
+                   (format "%s[INPUT WILL NOT BE HIDDEN!] " prompt) ; bug#17839
+                 prompt)
+               nil t default)) ; t = "no history"
           (when (buffer-live-p minibuf)
             (with-current-buffer minibuf
               ;; Not sure why but it seems that there might be cases where the