diff options
author | Glenn Morris <[email protected]> | 2014-06-26 15:00:42 -0400 |
---|---|---|
committer | Glenn Morris <[email protected]> | 2014-06-26 15:00:42 -0400 |
commit | 64c3533166e1fa517422f89f953cfdaea6ee7bf0 (patch) | |
tree | b317a5770db12cd74bbef35757965878b88b158e /lisp | |
parent | 2493e35c369caabf6a65e376fd0399e95b588bfd (diff) |
Warn about read-passwd in batch mode
* 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
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/subr.el | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c8f118c8a..0cc5b7fe71 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-06-26 Glenn Morris <[email protected]> + + * subr.el (read-passwd): Warn about batch mode. (Bug#17839) + 2014-06-26 Daiki Ueno <[email protected]> * emacs-lisp/package.el (package--check-signature): diff --git a/lisp/subr.el b/lisp/subr.el index 700c072a81..ac0e130b4e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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 |