diff options
| author | Stefan Monnier | 2009-08-19 19:42:25 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-08-19 19:42:25 +0000 |
| commit | 4fd15622e64cceb41dab27e0ffcfdcb8c4090861 (patch) | |
| tree | 7f492748c0ad3a6c2a036db7eb53cbf8d87ec50f | |
| parent | b3d8e4a025ffb5d45d744f96f9a1d4dcb5988ee1 (diff) | |
| download | emacs-4fd15622e64cceb41dab27e0ffcfdcb8c4090861.tar.gz emacs-4fd15622e64cceb41dab27e0ffcfdcb8c4090861.zip | |
(read-passwd): Use read-key so keypad keys work as well.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/subr.el | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 584cef20192..d8ffb2e9169 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2009-08-19 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2009-08-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * subr.el (read-passwd): Use read-key so keypad keys work as well. | ||
| 4 | |||
| 3 | * help.el (help-print-return-message): Rename from | 5 | * help.el (help-print-return-message): Rename from |
| 4 | print-help-return-message. | 6 | print-help-return-message. |
| 5 | 7 | ||
diff --git a/lisp/subr.el b/lisp/subr.el index 668b323fbc0..f2709f3b777 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1905,10 +1905,7 @@ by doing (clear-string STRING)." | |||
| 1905 | (while (progn (message "%s%s" | 1905 | (while (progn (message "%s%s" |
| 1906 | prompt | 1906 | prompt |
| 1907 | (make-string (length pass) ?.)) | 1907 | (make-string (length pass) ?.)) |
| 1908 | ;; We used to use read-char-exclusive, but that | 1908 | (setq c (read-key)) |
| 1909 | ;; gives funny behavior when the user presses, | ||
| 1910 | ;; e.g., the arrow keys. | ||
| 1911 | (setq c (read-event nil t)) | ||
| 1912 | (not (memq c stop-keys))) | 1909 | (not (memq c stop-keys))) |
| 1913 | (clear-this-command-keys) | 1910 | (clear-this-command-keys) |
| 1914 | (cond ((memq c rubout-keys) ; rubout | 1911 | (cond ((memq c rubout-keys) ; rubout |
| @@ -1916,6 +1913,7 @@ by doing (clear-string STRING)." | |||
| 1916 | (let ((new-pass (substring pass 0 -1))) | 1913 | (let ((new-pass (substring pass 0 -1))) |
| 1917 | (and (arrayp pass) (clear-string pass)) | 1914 | (and (arrayp pass) (clear-string pass)) |
| 1918 | (setq pass new-pass)))) | 1915 | (setq pass new-pass)))) |
| 1916 | ((eq c ?\C-g) (keyboard-quit)) | ||
| 1919 | ((not (numberp c))) | 1917 | ((not (numberp c))) |
| 1920 | ((= c ?\C-u) ; kill line | 1918 | ((= c ?\C-u) ; kill line |
| 1921 | (and (arrayp pass) (clear-string pass)) | 1919 | (and (arrayp pass) (clear-string pass)) |