Advice string-replace to use region instead of TM

This commit is contained in:
2022-08-12 12:46:58 +03:00
parent b421ea69f2
commit a8e0e12028

View File

@@ -194,3 +194,23 @@
(let ((beg (if region (region-beginning) beg))
(end (if region (region-end) end)))
(pulse-momentary-highlight-region beg end 'region))))
(define-advice perform-replace (:around (original-fun
from-string replacements
query-flag regexp-flag
delimited-flag
&optional repeat-count
map start end
backward
region-noncontiguous-p)
activate-region)
(let ((beg (region-beginning))
(end (region-end)))
(pulse-momentary-highlight-region beg end 'region)
(apply original-fun from-string replacements
query-flag regexp-flag
delimited-flag
repeat-count
map beg end
backward
region-noncontiguous-p)))