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: Thu, 25 Nov 2021 13:58:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> The idea is that whatever tests you need to do to with the position it
> finds, you do them at the beginning of the property, then you record
> the result in it->position, and use that to know when you are at the
> end of the property.

Oh, you mean keep adding when the min_width eq-ness doesn't change?  I
guess that could work, but I don't see how that'd simplify anything.

>> It's the same issue when called from display_string -- the mode line
>> machinery will call the function several times, even if the :propertize
>> is around all the specs.
>
> I don't think so, but maybe I misunderstand something.

I've tested, and it does.  It's only apparently in specs like
" (%l,%c)", though.

> I'm afraid that I'm missing something important here.

Yes, when called from the mode line we're postponing the stretch
computation until the :propertize run is actually over (in the
multiple-% case).

>   (insert "|" (propertize "foo" 'display '(min-width (8.0)) 'face 'match))
>
> doesn't work, either.  (All I did was remove the final "|" from the
> inserted string.)

Well, the stretch isn't realised until there's something to stretch too.
So at the end of the buffer it's a NOOP, which seems natural to me.

But we could change that, of course.

-- 
(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]