with @kbd{C-M-c} to proceed to the next occurrence.
@item e
-@itemx E
to edit the replacement string in the minibuffer. When you exit the
minibuffer by typing @key{RET}, the minibuffer contents replace the
current occurrence of the pattern. They also become the new
replacement string for any further occurrences.
+@item E
+is like @kbd{e}, but the next replacement will be done with exact
+case. I.e., if you have a @code{query-replace} from @samp{foo} to
+@samp{bar}, a text like @samp{Foo} will be normally be replaced with
+@samp{Bar}. Use this command to do the current replacement with exact
+case.
+
@item C-l
to redisplay the screen. Then you must type another character to
specify what to do with this occurrence.
\\`^' to move point back to previous match,
\\`u' to undo previous replacement,
\\`U' to undo all replacements,
-\\`E' to edit the replacement string.
+\\`e' to edit the replacement string.
+\\`E' to edit the replacement string with exact case.
In multi-buffer replacements type \\`Y' to replace all remaining
matches in all remaining buffers with no more questions,
\\`N' to skip to the next buffer without replacing remaining matches
(define-key map "Y" 'act)
(define-key map "N" 'skip)
(define-key map "e" 'edit-replacement)
- (define-key map "E" 'edit-replacement)
+ (define-key map "E" 'edit-replacement-exact-case)
(define-key map "," 'act-and-show)
(define-key map "q" 'exit)
(define-key map "\r" 'exit)
The valid answers include `act', `skip', `act-and-show',
`act-and-exit', `exit', `exit-prefix', `recenter', `scroll-up',
`scroll-down', `scroll-other-window', `scroll-other-window-down',
-`edit', `edit-replacement', `delete-and-edit', `automatic',
-`backup', `undo', `undo-all', `quit', and `help'.
+`edit', `edit-replacement', `edit-replacement-exact-case',
+`delete-and-edit', `automatic', `backup', `undo', `undo-all',
+`quit', and `help'.
This keymap is used by `y-or-n-p' as well as `query-replace'.")
(setq match-again (and (looking-at search-string)
(match-data)))))
;; Edit replacement.
- ((eq def 'edit-replacement)
+ ((or (eq def 'edit-replacement)
+ (eq def 'edit-replacement-exact-case))
(setq real-match-data (replace-match-data
nil real-match-data
real-match-data)
next-replacement
- (read-string "Edit replacement string: "
- next-replacement)
+ (read-string
+ (format "Edit replacement string%s: "
+ (if (eq def
+ 'edit-replacement-exact-case)
+ " (exact case)"
+ ""))
+ next-replacement)
noedit nil)
(if replaced
(set-match-data real-match-data)
(setq noedit
(replace-match-maybe-edit
- next-replacement nocasify literal noedit
+ next-replacement
+ (if (eq def 'edit-replacement-exact-case)
+ t
+ nocasify)
+ literal noedit
real-match-data backward)
replaced t)
(setq next-replacement-replaced next-replacement))