GNU bug report logs -
#20430
24.5; Enhancement request: extra hook for query-replace and friends
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20430 in the body.
You can then email your comments to 20430 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#20430
; Package
emacs
.
(Sun, 26 Apr 2015 17:27:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Chris <at> Chris-MacBook-Pro.local, "Poole <chris"@chrispoole.com
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 26 Apr 2015 17:27:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Would be very useful to have a hook that's called when the next
potential match item is shown with isearch, query-replace, etc.
Hook should run after point is moved to the next search hit and before
reading your input char.
Explanation and justification comes from answer to my question:
http://emacs.stackexchange.com/a/10903/7132
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#20430
; Package
emacs
.
(Tue, 02 Jun 2015 22:54:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 20430 <at> debbugs.gnu.org (full text, mbox):
> Would be very useful to have a hook that's called when the next
> potential match item is shown with isearch, query-replace, etc.
>
> Hook should run after point is moved to the next search hit and before
> reading your input char.
>
> Explanation and justification comes from answer to my question:
> http://emacs.stackexchange.com/a/10903/7132
It's possible to recenter in query-replace by adding an advice
on isearch-search-fun-default like it was possible to recenter
in isearch by advising isearch-update. To make it simpler,
a special hook `isearch-update-post-hook' was already added, so
a similar hook `replace-update-post-hook' could be added for
query-replace as well:
diff --git a/lisp/replace.el b/lisp/replace.el
index 1bf1343..fc47dda 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1978,6 +1978,9 @@ passed in. If LITERAL is set, no checking is done, anyway."
(when backward (goto-char (nth 0 match-data)))
noedit)
+(defvar replace-update-post-hook nil
+ "Function(s) to call after query-replace has found matches in the buffer.")
+
(defvar replace-search-function nil
"Function to use when searching for strings to replace.
It is used by `query-replace' and `replace-string', and is called
@@ -2274,6 +2276,7 @@ make, or the user didn't cancel the call."
(match-substitute-replacement next-replacement
nocasify literal))
next-replacement)))
+ (run-hooks 'replace-update-post-hook)
(message message
(query-replace-descr from-string)
(query-replace-descr replacement-presentation)))
Reply sent
to
Juri Linkov <juri <at> linkov.net>
:
You have taken responsibility.
(Thu, 24 Dec 2015 01:03:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Chris <at> Chris-MacBook-Pro.local, "Poole <chris"@chrispoole.com
:
bug acknowledged by developer.
(Thu, 24 Dec 2015 01:03:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 20430-done <at> debbugs.gnu.org (full text, mbox):
Thanks for the request, `replace-update-post-hook' is added now in bug#17453.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 21 Jan 2016 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 317 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.