--- replace.el 2015-06-02 09:04:57.944380000 -0400
+++ replace-editted.el 2015-06-02 09:08:22.038682000 -0400
@@ -2099,12 +2099,11 @@
;; Data for the next match. If a cons, it has the same format as
;; (match-data); otherwise it is t if a match is possible at point.
(match-again t)
-
(message
(if query-flag
(apply 'propertize
(substitute-command-keys
- "Query replacing %s with %s: (\\<query-replace-map>\\[help] for help) ")
+ "%sQuery replacing %s with %s: (\\<query-replace-map>\\[help] for help) ")
minibuffer-prompt-properties))))
;; If region is active, in Transient Mark mode, operate on region.
@@ -2275,6 +2274,8 @@
nocasify literal))
next-replacement)))
(message message
+ ;; Show whether `case-fold-search' is `t' or `nil'
+ (if case-fold-search "[case] " "[CaSe] ")
(query-replace-descr from-string)
(query-replace-descr replacement-presentation)))
(setq key (read-event))
@@ -2404,6 +2405,7 @@
(replace-dehighlight)
(save-excursion (recursive-edit))
(setq replaced t))
+ (def (call-interactively def)) ; User-defined key - invoke it.
;; Note: we do not need to treat `exit-prefix'
;; specially here, since we reread
;; any unrecognized character.
(defun drew/toggle-case ()
"Toggle the value of `case-fold-search' between `nil' and non-nil."
(interactive)
;; `case-fold-search' automatically becomes buffer-local when set
(setq case-fold-search (not case-fold-search)))
(define-key query-replace-map (kbd "C") #'drew/toggle-case)