[Top][All Lists]

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

Re: Tick Reduction

From: Eli Zaretskii
Subject: Re: Tick Reduction
Date: Wed, 24 Nov 2021 19:41:20 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: dgutov@yandex.ru,  stefankangas@gmail.com,  emacs-devel@gnu.org
> Date: Wed, 24 Nov 2021 18:10:06 +0100
> Eli Zaretskii <eliz@gnu.org> writes:
> > Btw, why don't you just record in the iterator the position where it
> > ends when you first see the property, instead of trying to identify
> > that by comparing property values?  The iterator structure has a
> > member called 'position' for this purpose.
> Hm...  how do I know where it ends when I see the start? 

There's the display_prop_end function we normally use for that.

> > In any case, can you please explain what the test bufpos == 0 tries to
> > test?  I'd like to understand the logic there.
> I may well have misunderstood something, but my bufpos == 0 test is
> testing whether I'm really being called from display_string.  If it not
> 0, I'm assuming I'm being called while displaying a buffer.

I guessed that much, but again: if you just want to test that you are
called from display_string, the test STRINGP (object) should be

And I'm confused by the fact that for buffers you test

   if (bufpos > BEGV && EQ (FOO, BAR))

whereas for a string you test

   if (bufpos == 0 && !EQ (FOO, BAR))

The equivalent of BEGV in strings is zero, so I'd expect

   if (bufpos > 0

and also why is the first case tests equality, whereas the second one
tests INequality?

IOW, the issue here AFAIU is that you might be called to display
buffer text with this property or to display a Lisp string with this
property, so the tests should be equivalent, and the only difference
between strings and buffers is that text starts at BEGV in buffers but
at zero in strings.  So why there are more differences that that?
What am I missing?

reply via email to

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