diff lisp/subr.el @ 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 7d0f4f179b3d
children caa79498564a
line wrap: on
line diff
--- 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))