all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#32220: 27.0.50; Prefer ?* to hide passwords
@ 2018-07-20  8:04 Tino Calancha
  2018-07-20 12:06 ` Stefan Monnier
  2018-07-27  2:31 ` Tino Calancha
  0 siblings, 2 replies; 5+ messages in thread
From: Tino Calancha @ 2018-07-20  8:04 UTC (permalink / raw)
  To: 32220; +Cc: tino.calancha, stefan monnier, noam postavsky


X-Debbugs-Cc: Stefan Monnier <monnier@iro.umontreal.ca>,Noam Postavsky <npostavs@gmail.com>,Eli Zaretskii <eliz@gnu.org>,tino.calancha@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@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:
 \f
 * 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)





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-29 12:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-20  8:04 bug#32220: 27.0.50; Prefer ?* to hide passwords Tino Calancha
2018-07-20 12:06 ` Stefan Monnier
2018-07-27  2:31 ` Tino Calancha
2018-07-27 12:34   ` Eli Zaretskii
2018-07-29 12:25     ` Tino Calancha

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.