changeset 104368:f700ef41d26c

(read-passwd): Use read-key so keypad keys work as well.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 19 Aug 2009 19:42:25 +0000
parents 13e0436a968a
children 5744c85d533a
files lisp/ChangeLog lisp/subr.el
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Aug 19 18:07:07 2009 +0000
+++ b/lisp/ChangeLog	Wed Aug 19 19:42:25 2009 +0000
@@ -1,5 +1,7 @@
 2009-08-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* subr.el (read-passwd): Use read-key so keypad keys work as well.
+
 	* help.el (help-print-return-message): Rename from
 	print-help-return-message.
 
--- a/lisp/subr.el	Wed Aug 19 18:07:07 2009 +0000
+++ b/lisp/subr.el	Wed Aug 19 19:42:25 2009 +0000
@@ -1905,10 +1905,7 @@
 	(while (progn (message "%s%s"
 			       prompt
 			       (make-string (length pass) ?.))
-		      ;; We used to use read-char-exclusive, but that
-		      ;; gives funny behavior when the user presses,
-		      ;; e.g., the arrow keys.
-		      (setq c (read-event nil t))
+		      (setq c (read-key))
 		      (not (memq c stop-keys)))
 	  (clear-this-command-keys)
 	  (cond ((memq c rubout-keys) ; rubout
@@ -1916,6 +1913,7 @@
 		   (let ((new-pass (substring pass 0 -1)))
 		     (and (arrayp pass) (clear-string pass))
 		     (setq pass new-pass))))
+                ((eq c ?\C-g) (keyboard-quit))
 		((not (numberp c)))
 		((= c ?\C-u) ; kill line
 		 (and (arrayp pass) (clear-string pass))