Mercurial > emacs
comparison lisp/map-ynp.el @ 4978:fec7580888dd
(map-y-or-n-p): Handle help-char values other than chars.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 11 Nov 1993 04:43:49 +0000 |
parents | 6b7954afe2bf |
children | 2f1e5e14dc25 |
comparison
equal
deleted
inserted
replaced
4977:81c44a01ddda | 4978:fec7580888dd |
---|---|
119 (setq quit-flag nil) | 119 (setq quit-flag nil) |
120 ;; Prompt the user about this object. | 120 ;; Prompt the user about this object. |
121 (let ((cursor-in-echo-area (not no-cursor-in-echo-area))) | 121 (let ((cursor-in-echo-area (not no-cursor-in-echo-area))) |
122 (message "%s(y, n, !, ., q, %sor %s) " | 122 (message "%s(y, n, !, ., q, %sor %s) " |
123 prompt user-keys | 123 prompt user-keys |
124 (key-description (char-to-string help-char))) | 124 (key-description (vector help-char))) |
125 (setq char (read-event))) | 125 (setq char (read-event))) |
126 ;; Show the answer to the question. | 126 ;; Show the answer to the question. |
127 (message "%s(y, n, !, ., q, %sor %s) %s" | 127 (message "%s(y, n, !, ., q, %sor %s) %s" |
128 prompt user-keys | 128 prompt user-keys |
129 (key-description (char-to-string help-char)) | 129 (key-description (vector help-char)) |
130 (single-key-description char)) | 130 (single-key-description char)) |
131 (setq def (lookup-key map (vector char))) | 131 (setq def (lookup-key map (vector char))) |
132 (cond ((eq def 'exit) | 132 (cond ((eq def 'exit) |
133 (setq next (function (lambda () nil)))) | 133 (setq next (function (lambda () nil)))) |
134 ((eq def 'act) | 134 ((eq def 'act) |
203 (setq next '(, next)) | 203 (setq next '(, next)) |
204 '(, elt))))) | 204 '(, elt))))) |
205 (t | 205 (t |
206 ;; Random char. | 206 ;; Random char. |
207 (message "Type %s for help." | 207 (message "Type %s for help." |
208 (key-description (char-to-string help-char))) | 208 (key-description (vector help-char))) |
209 (beep) | 209 (beep) |
210 (sit-for 1) | 210 (sit-for 1) |
211 (setq next (` (lambda () | 211 (setq next (` (lambda () |
212 (setq next '(, next)) | 212 (setq next '(, next)) |
213 '(, elt))))))) | 213 '(, elt))))))) |