emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to control isearch for invisible text


From: David Kastrup
Subject: Re: how to control isearch for invisible text
Date: Mon, 14 Aug 2006 14:24:45 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>> For reveal-mode, we should just provide a "pre-redisplay-hook" run,
>>> as the name indicates, just before doing redisplay.  That would
>>> allow reveal-mode to do the "show invisible text" even in
>>> query-replace and this without even changing query-replace's code.
>
>> That is a bit heavy-handed for my taste, at least for this purpose.
>> Such a hook would have to be global, as redisplay is not a
>> buffer-centric activity, and thus every function with a possible need
>> would have to register and unregister there, and check the state
>> across buffers for every redisplay.
>
> I doubt it's that hard to implement a proper pre-redisplay-hook which can be
> set buffer-locally.

This is pretty useless, since in your kind of application, it would be
important to know window-point rather than point.  The documentation
of window-point already states:

    window-point is a built-in function in `C source code'.
    (window-point &optional WINDOW)

    Return current value of point in WINDOW.
    For a nonselected window, this is the value point would have
    if that window were selected.

    Note that, when WINDOW is the selected window and its buffer
    is also currently selected, the value returned is the same as (point).
    It would be more strictly correct to return the `top-level' value
    of point, outside of any save-excursion forms.
    But that is hard to define.

    [back]

And that is precisely the same problem with reveal-mode: sit-for can
be called inside of save-excursions, and the current window-point need
not correspond with the point relevant at top-level.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]