GNU bug report logs -
#17453
Isearch doesn't work properly with Follow Mode.
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Fri, 9 May 2014 22:50:02 UTC
Severity: normal
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello, Juri.
On Fri, Nov 27, 2015 at 01:03:43AM +0200, Juri Linkov wrote:
> > This means the use of `query-replace' whilst Follow Mode is enabled is
> > not going to work properly, without some radical change in replace.el.
> > Probably the smallest change would be to invoke new hooks
> > `pre-replace-command-hook' and `post-replace-command-hook' from
> > `query-replace''s command loop.
> > A more satisfying change would be to get rid of `perform-replace' and
> > use Emacs's command loop the way Isearch does. This would probably not
> > be all that difficult. Do you know if there's any special reason
> > `query-replace' implements its own command loop?
> The patch in bug#20430 awaits the possibility of helping to fix this
> problem. It adds a new hook replace-update-post-hook that is like
> its isearch counterpart hook isearch-update-post-hook is the right way
> to handle display updates like syncing follow windows, etc.
Does this patch exist, yet?
It bothers me a little that we might be adding hook after hook into
Emacs, each one for a single special purpose.
Would it not perhaps be better to call `isearch-update-post-hook' also
from `perform-replace', since that would be more economical with hooks;
the meaning of the hook invocation would be "the same" in Isearch and
`perform-replace' - "hook called after having moved to the next match".
> Together with changing the order of calling isearch-update-post-hook
> and isearch-lazy-highlight-new-loop in isearch-update, adding
> follow-post-command-hook to isearch-update-post-hook, and adding
> follow-post-command-hook to replace-update-post-hook to handle
> follow-mode in query-replace will comprise the least radical change
> just before the next release.
This sounds like a good idea. Though, again, I think calling
isearch-update-post-hook from `query-replace' would be better than
implementing a new hook.
> Do you see a shortcoming of this course of action?
Only that it is working around the problems in replace.el rather than
fixing them. But to fix them properly would mean a radical redesign of
`perform-replace', or superseding it altogether, which is probably best
postponed until 25.2 or later. I still think `post-command-hook' is the
best hook for us to use - but it isn't called from `query-replace'.
Would it still be possible to mark `isearch-update-post-hook' as "for
internal use only", so that we could get rid of it later?
--
Alan Mackenzie (Nuremberg, Germany).
This bug report was last modified 9 years and 218 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.