GNU bug report logs -
#32220
27.0.50; Prefer ?* to hide passwords
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Fri, 20 Jul 2018 08:05:02 UTC
Severity: wishlist
Found in version 27.0.50
Done: Tino Calancha <tino.calancha <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#32220: 27.0.50; Prefer ?* to hide passwords
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 32220 <at> debbugs.gnu.org.
--
32220: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32220
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Cc: 32220 <at> debbugs.gnu.org
>> Date: Fri, 27 Jul 2018 11:31:08 +0900
>>
>> Eli, which branch is suitable for this patch? Next release or master?
>
> Master, I think.
Thank you.
Pushed into the master branch as commit 'Prefer ?* to hide passwords'
(b3f7e73fb76a366dc644ee2e6b9f4897c17d201d)
[Message part 3 (message/rfc822, inline)]
X-Debbugs-Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>,Noam Postavsky <npostavs <at> gmail.com>,Eli Zaretskii <eliz <at> gnu.org>,tino.calancha <at> gmail.com
It might be argued that a hidden string is more legible when using
?* as the hidden character instead of ?.
For example, the following strings have the same length:
"......"
"******"
Following patch uses ?* as default character to hide passwords instead
of ?.
--8<-----------------------------cut here---------------start------------->8---
commit 6b5c3db59650590d9db24ef110b972019b24e03a
Author: Tino Calancha <tino.calancha <at> gmail.com>
Date: Fri Jul 20 16:58:33 2018 +0900
Prefer ?* to hide passwords
It might be argued that a hidden string is more legible when using
?* as the hidden character instead of ?.
For example, the following strings have the same length:
"......"
"******"
It's slighly easier to visually count the number of characters in the second
string (Bug#32220).
* lisp/subr.el (read-passwd): Prefer ?* as default char instead of ?.
* doc/lispref/minibuf.texi (Reading a Password): Update manual.
; * etc/NEWS (Changes in Emacs 27.1): Announce the change.
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 889b64af8a..d091787a68 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -2199,7 +2199,7 @@ Reading a Password
@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. If you want to apply
+@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.
diff --git a/etc/NEWS b/etc/NEWS
index 8275cbb72c..f21da91a4b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -84,6 +84,9 @@ work right without some adjustment:
* Changes in Emacs 27.1
++++
+** The function 'read-passwd' uses '*' as default character to hide passwords.
+
---
** New variable 'xft-ignore-color-fonts'.
Default t means don't try to load color fonts when using Xft, as they
diff --git a/lisp/subr.el b/lisp/subr.el
index 10343e69db..59a6209af3 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2305,7 +2305,7 @@ read-passwd
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.
+This function echoes `*' for each character that the user types.
You could let-bind `read-hide-char' to another hiding character, though.
Once the caller uses the password, it can erase the password
@@ -2331,7 +2331,7 @@ read-passwd
beg)))
(dotimes (i (- end beg))
(put-text-property (+ i beg) (+ 1 i beg)
- 'display (string (or read-hide-char ?.))))))
+ 'display (string (or read-hide-char ?*))))))
minibuf)
(minibuffer-with-setup-hook
(lambda ()
@@ -2346,7 +2346,7 @@ read-passwd
(add-hook 'after-change-functions hide-chars-fun nil 'local))
(unwind-protect
(let ((enable-recursive-minibuffers t)
- (read-hide-char (or read-hide-char ?.)))
+ (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
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 27.0.50 (build 18, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
of 2018-07-20
Repository revision: fb24ce37d1bc258cfc3884d9828aa0602fa06e1d
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)
This bug report was last modified 6 years and 293 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.