emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] User-defined fringe tooltips (a request for review)


From: Eli Zaretskii
Subject: Re: [PATCH] User-defined fringe tooltips (a request for review)
Date: Mon, 25 Mar 2024 19:11:41 +0200

> From: Vladimir Kazanov <vekazanov@gmail.com>
> Date: Mon, 25 Mar 2024 15:55:16 +0000
> Cc: emacs-devel@gnu.org
> 
> The code in the (note_fringe_highlight) function works outside of the
> main (handle_single_display_spec) call. So to get to the :help-echo
> string it has to parse into the spec, or a list of specs, or a vector
> of specs, effectively duplicating parsing logic in
> handle_single_display_spec. This is not nice but doable.
> 
> But every display spec can be wrapped in a (when CONDITION . SPEC)
> form. And because (handle_single_display_spec) happens at a time
> different from the (note_fringe_highlight) call time we can never be
> sure that the condition still holds even if the code reevaluates
> CONDITION.

The condition is only evaluated at glyph generation time, as for any
other display property.  When the tooltip should be displayed, the
condition is not relevant, since if it were false when the glyphs were
generated, you wouldn't have had the fringe bitmap shown in the first
place.

However, I think there's an easy way of making the implementation
easier: just introduce a new overlay property called, say,
fringe-help-echo, and put that property on the same text as the
display property which produces the fringe.  Then the code in
note_fringe_highlight should simply check if the text which yielded
the fringe bitmap also has this special property on it, and if so,
display the tooltip.



reply via email to

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