summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/subr.el13
2 files changed, 10 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4e19be4d3ea..3965da7287b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-11 Michael Albinus <michael.albinus@gmx.de>
+
+ * subr.el (read-passwd): Use `read-hide-char' if non-nil. Bind it
+ when calling `read-string'. (Bug#17839)
+
2014-07-10 Eli Zaretskii <eliz@gnu.org>
* files.el (warn-maybe-out-of-memory): Fix the wording of the
diff --git a/lisp/subr.el b/lisp/subr.el
index a0c56bf9752..9accb9d36c5 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2016,7 +2016,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!
+You could let-bind `read-hide-char' to another hiding character, though.
Once the caller uses the password, it can erase the password
by doing (clear-string STRING)."
@@ -2041,7 +2041,7 @@ by doing (clear-string STRING)."
beg)))
(dotimes (i (- end beg))
(put-text-property (+ i beg) (+ 1 i beg)
- 'display (string ?.)))))
+ 'display (string (or read-hide-char ?.))))))
minibuf)
(minibuffer-with-setup-hook
(lambda ()
@@ -2055,12 +2055,9 @@ by doing (clear-string STRING)."
(setq-local show-paren-mode nil) ;bug#16091.
(add-hook 'after-change-functions hide-chars-fun nil 'local))
(unwind-protect
- (let ((enable-recursive-minibuffers t))
- (read-string
- (if noninteractive
- (format "%s[INPUT WILL NOT BE HIDDEN!] " prompt) ; bug#17839
- prompt)
- nil t default)) ; t = "no history"
+ (let ((enable-recursive-minibuffers t)
+ (read-hide-char (or read-hide-char ?.)))
+ (read-string 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