changeset 10057:460fecc93446

(query-replace-map): Define \e and escape as exit-prefix. (perform-replace): When exiting and rereading, set this-command to mode-exit.
author Richard M. Stallman <rms@gnu.org>
date Wed, 23 Nov 1994 09:10:36 +0000
parents 920dae6ba331
children 5803ff60cf47
files lisp/replace.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/replace.el	Wed Nov 23 04:46:14 1994 +0000
+++ b/lisp/replace.el	Wed Nov 23 09:10:36 1994 +0000
@@ -446,7 +446,7 @@
 The \"bindings\" in this map are not commands; they are answers.
 The valid answers include `act', `skip', `act-and-show',
 `exit', `act-and-exit', `edit', `delete-and-edit', `recenter',
-`automatic', `backup', and `help'.")
+`automatic', `backup', `exit-prefix', and `help'.")
 
 (define-key query-replace-map " " 'act)
 (define-key query-replace-map "\d" 'skip)
@@ -470,6 +470,8 @@
 (define-key query-replace-map "?" 'help)
 (define-key query-replace-map "\C-g" 'quit)
 (define-key query-replace-map "\C-]" 'quit)
+(define-key query-replace-map "\e" 'exit-prefix)
+(define-key query-replace-map [escape] 'exit-prefix)
 
 (defun perform-replace (from-string replacements
 		        query-flag regexp-flag delimited-flag
@@ -626,7 +628,11 @@
 			(prog1 (match-data)
 			  (save-excursion (recursive-edit))))
 		       (setq replaced t))
+		      ;; Note: we do not need to treat `exit-prefix'
+		      ;; specially here, since we reread
+		      ;; any unrecognized character.
 		      (t
+		       (setq this-command 'mode-exited)
 		       (setq keep-going nil)
 		       (setq unread-command-events
 			     (append (listify-key-sequence key)