diff options
| author | Richard M. Stallman | 1994-11-23 09:10:36 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-11-23 09:10:36 +0000 |
| commit | d9121bc0e6d3571e2ee2cda20199a985e594b5e4 (patch) | |
| tree | 376dbb45d59854c0d9a4f01c594d8ec3a6e8829f /lisp | |
| parent | 5b3dd5e8b830d9dd38a5d7a56e6e62dc67b7272e (diff) | |
| download | emacs-d9121bc0e6d3571e2ee2cda20199a985e594b5e4.tar.gz emacs-d9121bc0e6d3571e2ee2cda20199a985e594b5e4.zip | |
(query-replace-map): Define \e and escape as exit-prefix.
(perform-replace): When exiting and rereading, set
this-command to mode-exit.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/replace.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 9e9e84c8e96..10c41344006 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -446,7 +446,7 @@ C-l to clear the screen, redisplay, and offer same replacement again, | |||
| 446 | The \"bindings\" in this map are not commands; they are answers. | 446 | The \"bindings\" in this map are not commands; they are answers. |
| 447 | The valid answers include `act', `skip', `act-and-show', | 447 | The valid answers include `act', `skip', `act-and-show', |
| 448 | `exit', `act-and-exit', `edit', `delete-and-edit', `recenter', | 448 | `exit', `act-and-exit', `edit', `delete-and-edit', `recenter', |
| 449 | `automatic', `backup', and `help'.") | 449 | `automatic', `backup', `exit-prefix', and `help'.") |
| 450 | 450 | ||
| 451 | (define-key query-replace-map " " 'act) | 451 | (define-key query-replace-map " " 'act) |
| 452 | (define-key query-replace-map "\d" 'skip) | 452 | (define-key query-replace-map "\d" 'skip) |
| @@ -470,6 +470,8 @@ The valid answers include `act', `skip', `act-and-show', | |||
| 470 | (define-key query-replace-map "?" 'help) | 470 | (define-key query-replace-map "?" 'help) |
| 471 | (define-key query-replace-map "\C-g" 'quit) | 471 | (define-key query-replace-map "\C-g" 'quit) |
| 472 | (define-key query-replace-map "\C-]" 'quit) | 472 | (define-key query-replace-map "\C-]" 'quit) |
| 473 | (define-key query-replace-map "\e" 'exit-prefix) | ||
| 474 | (define-key query-replace-map [escape] 'exit-prefix) | ||
| 473 | 475 | ||
| 474 | (defun perform-replace (from-string replacements | 476 | (defun perform-replace (from-string replacements |
| 475 | query-flag regexp-flag delimited-flag | 477 | query-flag regexp-flag delimited-flag |
| @@ -626,7 +628,11 @@ which will run faster and probably do exactly what you want." | |||
| 626 | (prog1 (match-data) | 628 | (prog1 (match-data) |
| 627 | (save-excursion (recursive-edit)))) | 629 | (save-excursion (recursive-edit)))) |
| 628 | (setq replaced t)) | 630 | (setq replaced t)) |
| 631 | ;; Note: we do not need to treat `exit-prefix' | ||
| 632 | ;; specially here, since we reread | ||
| 633 | ;; any unrecognized character. | ||
| 629 | (t | 634 | (t |
| 635 | (setq this-command 'mode-exited) | ||
| 630 | (setq keep-going nil) | 636 | (setq keep-going nil) |
| 631 | (setq unread-command-events | 637 | (setq unread-command-events |
| 632 | (append (listify-key-sequence key) | 638 | (append (listify-key-sequence key) |