emacs-devel
[Top][All Lists]
Advanced

[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:05:32 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: dgutov@yandex.ru,  stefankangas@gmail.com,  emacs-devel@gnu.org
> Date: Wed, 24 Nov 2021 17:28:17 +0100
> 
> >> 1) Should the stretch have been inserted "before the foo ended", i.e.,
> >> with that face extending to the end of the range?
> >
> > You are saying that the stretch doesn't use the same face as the
> > characters "covered" by this property?  If so, why not use the same
> > face ID?  If that's not what you are saying, then what are you saying?
> 
> I'm asking, I'm not saying.

OK, but then I don't think I see a problem.  The display code will
keep using the same face until something changes it.  So if you don't
touch it->face_id in your code, the stretch will be displayed in the
same face as the text covered by this property.

Is that what you wanted to ask?  Does that answer your question?

> >> 2) To identify a range, we need an identity
> >
> > You are saying "a range", here and in the documentation you installed,
> > but you never explain what that means in this context.  Can you
> > explain what you mean by that, and why do you need to identify that
> > range?
> 
> "A group of consecutive characters".  And it needs to be identified,
> because that's the thing that has a minimum width.

You mean, the text "covered" by this property?

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.

> > Then, if it _is_ a string, I don't understand the test for bufpos == 0
> > vs bufpos > BEGV in the case of a buffer, and I also don't understand
> > the reverse condition of the property equality.  Can you explain what
> > is going on here and why?
> 
> This doesn't deal with strings at all.  It's display_string (i.e., the
> mode line) or a buffer.  Adding support for strings, too, might be nice.

Sorry, I don't understand: the functions which call display_min_width
are general-purpose display code, they are used for displaying both
buffer text and Lisp strings.  In fact, displaying the mode line
already means that strings are supported, because the mode line is
constructed from Lisp strings, not from buffer text.

In any case, can you please explain what the test bufpos == 0 tries to
test?  I'd like to understand the logic there.



reply via email to

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