emacs-devel
[Top][All Lists]
Advanced

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

Re: Horizontal centering in the display engine


From: Eli Zaretskii
Subject: Re: Horizontal centering in the display engine
Date: Wed, 14 Apr 2021 18:52:43 +0300

> From: sbaugh@catern.com
> Date: Wed, 14 Apr 2021 11:25:41 -0400
> 
> > You want the display engine to evaluate the function call for you?
> > That's not possible at the moment, the expression language accepted by
> > :align-to is somewhat limited.  It can automatically react to changes
> > in a variable's value, but in that case it must be the same variable
> > for all the lines, and that contradicts what you want to do.
> 
> Yes, that makes sense.  So I'm asking about how difficult it would be to
> add a new element to the :align-to expression language, one which
> specifies the width of the current line.

I don't quite see how to implement this, while keeping the existing
design of the display code.  The problem here is that the length of
the text on a line is known only when the entire line has been laid
out.  But the display code must work correctly even when only part of
the line is being processed: it is sometimes invoked in the middle of
a line, and doesn't get to the end of a line before it's expected to
produce the results.  E.g., the code that supports cursor motion needs
to be able to work like that, and there are some other important use
cases which need that.

In general, the display code examines the text one character at a
time, and makes its layout decisions on the spot.  Thus, features that
require some kind of overall view of the line aren't easy to
implement.



reply via email to

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