emacs-devel
[Top][All Lists]
Advanced

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

Re: Tick Reduction


From: Lars Ingebrigtsen
Subject: Re: Tick Reduction
Date: Tue, 23 Nov 2021 11:15:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> For starters, here's a thought: why not make this feature a variant of
> the 'display' property, rather than inventing a new kind of property?
> We already have similar variants of 'display': (height HEIGHT) and
> (raise FACTOR), and this one sounds similar enough.

Sure, that makes sense.  (Perhaps we should add a convenience function a
la `add-face-text-property', but for `display', because `min-width' is
something you'd typically want to slap on arbitrary things, like a text
that contains a small image mixed in with letters.)

> In short: the processing of 'display' properties is already well
> integrated into the overall design of the display engine, so adding
> there one more variety should be relatively easy.

Sounds good; I'll have a try at implementing it that way (but probably
not today).

> And one other important thing: never call append_FOO_glyph directly.
> Instead, call produce_FOO_glyph.  That's because produce_FOO_glyph
> already takes care of many things that you otherwise will have to do
> manually (and make mistakes).  For example, this:
>
>> +static enum prop_handled
>> +handle_min_width_prop (struct it *it)
>> +{
>> +  if (STRINGP (it->string) || !it->glyph_row)
>> +    return HANDLED_NORMALLY;
>
> is unacceptable: when it->glyph_row is NULL, it usually means we are
> emulating redisplay without producing glyphs, but the data in 'it'
> still needs to be maintained as if we did, because otherwise stuff
> like vertical-motion and its callers will stop working.  You will see
> in produce_stretch_glyph that it does get this case correctly.

Ah, I see.  Thanks for the tips.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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