blob: 6ed773fb64ba89ffceecc63062310945186c49b4 (
plain)
1
2
3
4
5
6
7
8
9
10
|
<h3 class="section">Reading a Password</h3> <p>To read a password to pass to another program, you can use the function <code>read-passwd</code>. </p> <dl> <dt id="read-passwd">Function: <strong>read-passwd</strong> <em>prompt &optional confirm default</em>
</dt> <dd>
<p>This function reads a password, prompting with <var>prompt</var>. It does not echo the password as the user types it; instead, it echoes ‘<samp>*</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</code> with that character. </p> <p>The optional argument <var>confirm</var>, if non-<code>nil</code>, says to read the password twice and insist it must be the same both times. If it isn’t the same, the user has to type it over and over until the last two times match. </p> <p>The optional argument <var>default</var> specifies the default password to return if the user enters empty input. If <var>default</var> is <code>nil</code>, then <code>read-passwd</code> returns the null string in that case. </p>
</dd>
</dl><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Reading-a-Password.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Reading-a-Password.html</a>
</p>
</div>
|