Mercurial > emacs
comparison lisp/macros.el @ 2707:4661157d5c60
(kbd-macro-query): Use query-replace-map to define answers.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 09 May 1993 17:58:55 +0000 |
parents | 10e417efb12a |
children | a9d400ee1c0e |
comparison
equal
deleted
inserted
replaced
2706:c52476200bec | 2707:4661157d5c60 |
---|---|
122 (if flag | 122 (if flag |
123 (let (executing-macro defining-kbd-macro) | 123 (let (executing-macro defining-kbd-macro) |
124 (recursive-edit)) | 124 (recursive-edit)) |
125 (if (not executing-macro) | 125 (if (not executing-macro) |
126 nil | 126 nil |
127 (let ((loop t)) | 127 (let ((loop t) |
128 (msg (substitute-command-keys | |
129 "Proceed with macro?\\<query-replace-map>\ | |
130 (\\[act], \\[skip], \\[exit], \\[recenter], \\[edit]"))) | |
128 (while loop | 131 (while loop |
129 (let ((char (let ((executing-macro nil) | 132 (let ((key (let ((executing-macro nil) |
130 (defining-kbd-macro nil)) | 133 (defining-kbd-macro nil)) |
131 (message "Proceed with macro? (Space, DEL, C-d, C-r or C-l) ") | 134 (message msg) |
132 (read-char)))) | 135 (read-event))) |
133 (cond ((= char ? ) | 136 def) |
137 (setq key (vector key)) | |
138 (setq def (lookup-key query-replace-map key)) | |
139 (cond ((eq def 'act) | |
134 (setq loop nil)) | 140 (setq loop nil)) |
135 ((= char ?\177) | 141 ((eq def 'skip) |
136 (setq loop nil) | 142 (setq loop nil) |
137 (setq executing-macro "")) | 143 (setq executing-macro "")) |
138 ((= char ?\C-d) | 144 ((eq def 'exit) |
139 (setq loop nil) | 145 (setq loop nil) |
140 (setq executing-macro t)) | 146 (setq executing-macro t)) |
141 ((= char ?\C-l) | 147 ((eq def 'recenter) |
142 (recenter nil)) | 148 (recenter nil)) |
143 ((= char ?\C-r) | 149 ((eq def 'edit) |
144 (let (executing-macro defining-kbd-macro) | 150 (let (executing-macro defining-kbd-macro) |
145 (recursive-edit)))))))))) | 151 (recursive-edit))) |
152 ((eq def 'quit) | |
153 (setq quit-flag t)) | |
154 (t | |
155 (or (eq def 'help) | |
156 (ding)) | |
157 (with-output-to-temp-buffer "*Help*" | |
158 (princ | |
159 (substitute-command-keys | |
160 "Specify how to procede with keyboard macro execution. | |
161 Possibilities: \\<query-replace-map> | |
162 \\[act] Finish this iteration normally and continue with the next. | |
163 \\[skip] Skip the rest of this iteration, and start the next. | |
164 \\[exit] Stop the macro entirely right now. | |
165 \\[recenter] Redisplay the screen, then ask again. | |
166 \\[edit] Enter recursive edit; ask again when you exit from that.")))) | |
167 ))))))) | |
146 | 168 |
147 ;;;###autoload | 169 ;;;###autoload |
148 (defun apply-macro-to-region-lines (top bottom &optional macro) | 170 (defun apply-macro-to-region-lines (top bottom &optional macro) |
149 "For each complete line between point and mark, move to the beginning | 171 "For each complete line between point and mark, move to the beginning |
150 of the line, and run the last keyboard macro. | 172 of the line, and run the last keyboard macro. |