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 16:20:35 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: dgutov@yandex.ru,  stefankangas@gmail.com,  emacs-devel@gnu.org
> Date: Wed, 24 Nov 2021 12:07:08 +0100
> 
> I've now pushed the new min-width thing, but there's things here that
> could be tweaked.
> 
> Basically, you can now say
> 
> (insert "|" (propertize "foo" 'display '(min-width (8.0)) 'face 'match) "|")
> 
> and then this will occupy eight normal character widths:

Thanks.  A couple of comments/questions:

Is it possible to use an integer value instead of a float, and if so,
what is the semantics of that?

> 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?

> 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?

And finally, I don't understand this recent addition:

      /* When called form display_string (i.e., the mode line),
         we're being called with a string as the object, and we
         may be called with many sub-strings belonging to the same
         :propertize run. */
      if ((bufpos == 0
           && !EQ (it->min_width_property,
                   get_display_property (0, Qmin_width, object)))
          /* In a buffer -- check that we're really right after the
             sequence of characters covered by this `min-width'.  */
          || (bufpos > BEGV
              && EQ (it->min_width_property,
                     get_display_property (bufpos - 1, Qmin_width, object))))

To support a Lisp string as OBJECT, you need first to test for that:

  if (STRINGP (object))
     ....

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?



reply via email to

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