aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-09 17:58:55 +0000
committerRichard M. Stallman1993-05-09 17:58:55 +0000
commitaf400c0042489fe5a420f6739769d75fbc0e5144 (patch)
tree9e88fb8c9be125a91af54999c9cfbf2907d1bc2d
parent4c2c1de1fdfcc2ea868df0fb9f3843efe5cf4267 (diff)
downloademacs-af400c0042489fe5a420f6739769d75fbc0e5144.tar.gz
emacs-af400c0042489fe5a420f6739769d75fbc0e5144.zip
(kbd-macro-query): Use query-replace-map to define answers.
-rw-r--r--lisp/macros.el44
1 files changed, 33 insertions, 11 deletions
diff --git a/lisp/macros.el b/lisp/macros.el
index 41c021897cd..a6b50c4732a 100644
--- a/lisp/macros.el
+++ b/lisp/macros.el
@@ -124,25 +124,47 @@ C-l -- redisplay screen and ask again."
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.
161Possibilities: \\<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)