[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17453: Framework extending window functions for Follow Mode (etc.).
From: |
Alan Mackenzie |
Subject: |
bug#17453: Framework extending window functions for Follow Mode (etc.). |
Date: |
Mon, 30 Nov 2015 20:37:23 +0000 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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).
- bug#17453: Framework extending window functions for Follow Mode (etc.)., (continued)
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Juri Linkov, 2015/11/11
- bug#17453: Framework extending window functions for Follow Mode (etc.)., martin rudalics, 2015/11/12
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Juri Linkov, 2015/11/12
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Alan Mackenzie, 2015/11/17
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Juri Linkov, 2015/11/17
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Alan Mackenzie, 2015/11/18
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Alan Mackenzie, 2015/11/18
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Juri Linkov, 2015/11/18
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Alan Mackenzie, 2015/11/25
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Juri Linkov, 2015/11/26
- bug#17453: Framework extending window functions for Follow Mode (etc.).,
Alan Mackenzie <=
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Juri Linkov, 2015/11/30
- bug#17453: Framework extending window functions for Follow Mode (etc.)., Alan Mackenzie, 2015/11/12