;; (match-data); otherwise it is t if a match is possible at point.
(match-again t)
- (isearch-string isearch-string)
- (isearch-regexp isearch-regexp)
- (isearch-case-fold-search isearch-case-fold-search)
(message
(if query-flag
(substitute-command-keys
(regexp-quote from-string))
"\\b")))
(when query-replace-lazy-highlight
- (setq isearch-string search-string
- isearch-regexp (or delimited-flag regexp-flag)
- isearch-case-fold-search case-fold-search
- isearch-lazy-highlight-last-string nil))
+ (setq isearch-lazy-highlight-last-string nil))
(push-mark)
(undo-boundary)
(let ((inhibit-read-only
query-replace-skip-read-only))
(unless (or literal noedit)
- (replace-highlight (nth 0 real-match-data)
- (nth 1 real-match-data)
- start end))
+ (replace-highlight
+ (nth 0 real-match-data) (nth 1 real-match-data)
+ start end search-string
+ (or delimited-flag regexp-flag) case-fold-search))
(setq noedit
(replace-match-maybe-edit
next-replacement nocasify literal
;; `real-match-data'.
(while (not done)
(set-match-data real-match-data)
- (replace-highlight (match-beginning 0) (match-end 0)
- start end)
+ (replace-highlight
+ (match-beginning 0) (match-end 0)
+ start end search-string
+ (or delimited-flag regexp-flag) case-fold-search)
;; Bind message-log-max so we don't fill up the message log
;; with a bunch of identical messages.
(let ((message-log-max nil))
unread-command-events))
(setq done t)))
(when query-replace-lazy-highlight
- ;; Restore isearch data for lazy highlighting
- ;; in case of isearching during recursive edit
- (setq isearch-string search-string
- isearch-regexp (or delimited-flag regexp-flag)
- isearch-case-fold-search case-fold-search)
;; Force lazy rehighlighting only after replacements
(if (not (memq def '(skip backup)))
(setq isearch-lazy-highlight-last-string nil))))
(defvar replace-overlay nil)
-(defun replace-highlight (match-beg match-end range-beg range-end)
+(defun replace-highlight (match-beg match-end range-beg range-end
+ string regexp case-fold)
(if query-replace-highlight
(if replace-overlay
(move-overlay replace-overlay match-beg match-end (current-buffer))
(setq replace-overlay (make-overlay match-beg match-end))
(overlay-put replace-overlay 'priority 1) ;higher than lazy overlays
(overlay-put replace-overlay 'face 'query-replace)))
- (when query-replace-lazy-highlight
- (isearch-lazy-highlight-new-loop range-beg range-end)))
+ (if query-replace-lazy-highlight
+ (let ((isearch-string string)
+ (isearch-regexp regexp)
+ (isearch-case-fold-search case-fold))
+ (isearch-lazy-highlight-new-loop range-beg range-end))))
(defun replace-dehighlight ()
(when replace-overlay
(delete-overlay replace-overlay))
(when query-replace-lazy-highlight
- (isearch-lazy-highlight-cleanup lazy-highlight-cleanup)
+ (lazy-highlight-cleanup lazy-highlight-cleanup)
(setq isearch-lazy-highlight-last-string nil)))
;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4