comparison lisp/map-ynp.el @ 2082:4b05402f3ac5

(map-y-or-n-p): Handle `quit' as answer.
author Richard M. Stallman <rms@gnu.org>
date Tue, 09 Mar 1993 21:17:46 +0000
parents 2b04be5e47e6
children f692546797f9
comparison
equal deleted inserted replaced
2081:2b04be5e47e6 2082:4b05402f3ac5
109 (format (, prompter) object))))) 109 (format (, prompter) object)))))
110 (while (funcall next) 110 (while (funcall next)
111 (setq prompt (funcall prompter elt)) 111 (setq prompt (funcall prompter elt))
112 (if (stringp prompt) 112 (if (stringp prompt)
113 (progn 113 (progn
114 (setq quit-flag nil)
114 ;; Prompt the user about this object. 115 ;; Prompt the user about this object.
115 (let ((cursor-in-echo-area t)) 116 (let ((cursor-in-echo-area t))
116 (message "%s(y, n, !, ., q, %sor %s) " 117 (message "%s(y, n, !, ., q, %sor %s) "
117 prompt user-keys 118 prompt user-keys
118 (key-description (char-to-string help-char))) 119 (key-description (char-to-string help-char)))
130 ((eq def 'act-and-exit) 131 ((eq def 'act-and-exit)
131 ;; Act on the object and then exit. 132 ;; Act on the object and then exit.
132 (funcall actor elt) 133 (funcall actor elt)
133 (setq actions (1+ actions) 134 (setq actions (1+ actions)
134 next (function (lambda () nil)))) 135 next (function (lambda () nil))))
136 ((eq def 'quit)
137 (setq quit-flag t)
138 (setq next (` (lambda ()
139 (setq next '(, next))
140 '(, elt)))))
135 ((eq def 'automatic) 141 ((eq def 'automatic)
136 ;; Act on this and all following objects. 142 ;; Act on this and all following objects.
137 (if (eval (funcall prompter elt)) 143 (if (eval (funcall prompter elt))
138 (progn 144 (progn
139 (funcall actor elt) 145 (funcall actor elt)