Mercurial > emacs
changeset 28801:be3f5fa41e90
(query-replace-map): Add binding for `E'.
(query-replace-help): Extend help text.
(perform-replace): Allow editing the replacement string.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 03 May 2000 19:23:28 +0000 |
parents | d10b6cddbf91 |
children | f7eed599c0df |
files | lisp/replace.el |
diffstat | 1 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/replace.el Wed May 03 17:45:58 2000 +0000 +++ b/lisp/replace.el Wed May 03 19:23:28 2000 +0000 @@ -715,7 +715,8 @@ C-w to delete match and recursive edit, C-l to clear the screen, redisplay, and offer same replacement again, ! to replace all remaining matches with no more questions, -^ to move point back to previous match." +^ to move point back to previous match, +E to edit the replacement string" "Help message while in query-replace") (defvar query-replace-map (make-sparse-keymap) @@ -733,6 +734,7 @@ (define-key query-replace-map "n" 'skip) (define-key query-replace-map "Y" 'act) (define-key query-replace-map "N" 'skip) +(define-key query-replace-map "E" 'edit-replacement) (define-key query-replace-map "," 'act-and-show) (define-key query-replace-map "q" 'exit) (define-key query-replace-map "\r" 'exit) @@ -1011,6 +1013,16 @@ (if (and regexp-flag nonempty-match) (setq match-again (and (looking-at search-string) (match-data))))) + + ;; Edit replacement. + ((eq def 'edit-replacement) + (setq next-replacement + (read-input "Edit replacement string: " + next-replacement)) + (or replaced + (replace-match next-replacement nocasify literal)) + (setq done t)) + ((eq def 'delete-and-edit) (delete-region (match-beginning 0) (match-end 0)) (set-match-data