summaryrefslogtreecommitdiff
path: root/doc/lispref/minibuf.texi
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2014-07-11 11:09:54 +0200
committerMichael Albinus <michael.albinus@gmx.de>2014-07-11 11:09:54 +0200
commitc0ada759210b090944e0a23ed4879ca1a3ad38a7 (patch)
tree5bc957f5d30cc16af9add35e301e02c5c22bf89a /doc/lispref/minibuf.texi
parent644656aa562a78edf384abd6f4ce80bc930d5547 (diff)
downloademacs-c0ada759210b090944e0a23ed4879ca1a3ad38a7.tar.gz
Hide password in batch mode
* doc/lispref/minibuf.texi (Intro to Minibuffers, Reading a Password): Password hiding is available in batch mode, do not mention it in the exclusion list. Mention `read-hide-char'. * lisp/subr.el (read-passwd): Use `read-hide-char' if non-nil. Bind it when calling `read-string'. * src/minibuf.c (top): Include systty.h. Declare external emacs_get_tty and emacs_set_tty. (Vread_hide_char): New lisp variable. (read_minibuf_noninteractive): Hide characters with Vread_hide_char if it is a character. * src/sysdep.c (emacs_get_tty, emacs_set_tty): Make them externally visible. Fixes: debbugs:17839
Diffstat (limited to 'doc/lispref/minibuf.texi')
-rw-r--r--doc/lispref/minibuf.texi11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index e76b827cd2f..1c6a74a89fd 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -102,8 +102,8 @@ 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. This supports only basic input:
-none of the special minibuffer features (history, completion,
-password hiding, etc.) are available in batch mode.
+none of the special minibuffer features (history, completion, etc.)
+are available in batch mode.
@node Text from Minibuffer
@section Reading Text Strings with the Minibuffer
@@ -2147,9 +2147,10 @@ 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. (Note that in batch mode, the
-input is not hidden.)
+not echo the password as the user types it; instead, it echoes
+@samp{.} for each character in the password. If you want to apply
+another character to hide the password, let-bind the variable
+@code{read-hide-char} with that character.
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