unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Horizontal centering in the display engine
@ 2021-04-13 18:25 sbaugh
  2021-04-13 18:39 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: sbaugh @ 2021-04-13 18:25 UTC (permalink / raw)
  To: emacs-devel


The display engine supports display text left-aligned and right-aligned.
far as I can tell, it doesn't support displaying text centered.  This
would be useful for several things:

- User interfaces
- Presentations (this is my use case)

Currently there are a number of modes which implement a pseudo-centering
by inserting spaces based on the size of the window.  This has several
issues, among them that it doesn't automatically recenter when the
window size changes.

So it would be nice if the display engine natively supported displaying
centered text.

How difficult would this be to implement?  Could someone (namely, me)
with no prior exposure to the notoriously-complex display engine code
implement it in, say, a week of hacking?

Thanks!




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-13 18:25 sbaugh
@ 2021-04-13 18:39 ` Eli Zaretskii
  2021-04-13 19:28   ` sbaugh
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2021-04-13 18:39 UTC (permalink / raw)
  To: sbaugh; +Cc: emacs-devel

> From: sbaugh@catern.com
> Date: Tue, 13 Apr 2021 14:25:14 -0400
> 
> The display engine supports display text left-aligned and right-aligned.

What do you mean by "right-aligned"? can you give an example of such
an alignment?

> far as I can tell, it doesn't support displaying text centered.

Doesn't :align-to display spec allow to solve this problem?  Or maybe
I don't understand the use case well enough?



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-13 18:39 ` Eli Zaretskii
@ 2021-04-13 19:28   ` sbaugh
  2021-04-13 19:43     ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: sbaugh @ 2021-04-13 19:28 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:
>> The display engine supports display text left-aligned and right-aligned.
> What do you mean by "right-aligned"? can you give an example of such
> an alignment?

Ah, I was just vaguely gesturing at RTL support in Emacs. It's not
really relevant to what I was asking. But that's moot, because...

>> far as I can tell, it doesn't support displaying text centered.
>
> Doesn't :align-to display spec allow to solve this problem?  Or maybe
> I don't understand the use case well enough?

...this seems like exactly what I'm looking for! But, I don't think the
possible "pixel specifications" can support exactly the kind of
centering I want.

To have centered text, I think I'd want to do something like

:align-to (- center (0.5 . line-size))

Where line-size is the is the width in pixels of the specific line that
is being aligned.

This would put the center of the line of text in the center of the
window, and automatically recalculate that each time the line or window
changes size.

As far as I understand the documentation, there's no way to express
something like line-size currently? Maybe that could be easily added?

Thanks!




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-13 19:28   ` sbaugh
@ 2021-04-13 19:43     ` Eli Zaretskii
  2021-04-13 20:49       ` sbaugh
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2021-04-13 19:43 UTC (permalink / raw)
  To: sbaugh; +Cc: emacs-devel

> From: sbaugh@catern.com
> Date: Tue, 13 Apr 2021 15:28:06 -0400
> 
> > Doesn't :align-to display spec allow to solve this problem?  Or maybe
> > I don't understand the use case well enough?
> 
> ...this seems like exactly what I'm looking for! But, I don't think the
> possible "pixel specifications" can support exactly the kind of
> centering I want.
> 
> To have centered text, I think I'd want to do something like
> 
> :align-to (- center (0.5 . line-size))
> 
> Where line-size is the is the width in pixels of the specific line that
> is being aligned.
> 
> This would put the center of the line of text in the center of the
> window, and automatically recalculate that each time the line or window
> changes size.
> 
> As far as I understand the documentation, there's no way to express
> something like line-size currently? Maybe that could be easily added?

We have window-text-pixel-size, isn't that what you want?

If that doesn't help, then I guess I'll ask you to describe the use
case in more detail.  E.g., are you planning on centering each line
separately, or everything together, or something else?  IOW, how did
you envision you'd put the display property on each line? and how does
this work when the user types text to add more lines, or make a line
longer than the window? etc. etc.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-13 19:43     ` Eli Zaretskii
@ 2021-04-13 20:49       ` sbaugh
  2021-04-14  6:56         ` Eli Zaretskii
  2021-04-14  8:28         ` martin rudalics
  0 siblings, 2 replies; 19+ messages in thread
From: sbaugh @ 2021-04-13 20:49 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:
>> From: sbaugh@catern.com
>> To have centered text, I think I'd want to do something like
>> 
>> :align-to (- center (0.5 . line-size))
>> 
>> [...]
>> 
>> As far as I understand the documentation, there's no way to express
>> something like line-size currently? Maybe that could be easily added?
>
> We have window-text-pixel-size, isn't that what you want?

But that can't be used in a pixel specification, as far as I understand?

And anyway, I don't think that's right - as the Elisp manual says,
"window-text-pixel-size treats the text displayed in a window as a whole
and does not care about the size of individual lines."

> If that doesn't help, then I guess I'll ask you to describe the use
> case in more detail.

The behavior I want is what's described here:
https://en.wikipedia.org/wiki/Typographic_alignment#Centered

There's a picture on that page captioned "Centered text" which shows the
desired behavior.

> E.g., are you planning on centering each line separately, or
> everything together, or something else?

Each line separately.

> IOW, how did you envision you'd put the display property on each line?

The same display property would be applied to every line.

> and how does this work when the user types text to add more lines, or
> make a line longer than the window? etc. etc.

When they add more lines, those new lines are also centered.  If a line
is longer than the window, it's truncated or wrapped depending on
truncate-lines, word-wrap, etc., as usual.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-13 20:49       ` sbaugh
@ 2021-04-14  6:56         ` Eli Zaretskii
  2021-04-14 13:28           ` sbaugh
  2021-04-14  8:28         ` martin rudalics
  1 sibling, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2021-04-14  6:56 UTC (permalink / raw)
  To: sbaugh; +Cc: emacs-devel

> From: sbaugh@catern.com
> Date: Tue, 13 Apr 2021 16:49:59 -0400
> 
> >> :align-to (- center (0.5 . line-size))
> >> 
> >> [...]
> >> 
> >> As far as I understand the documentation, there's no way to express
> >> something like line-size currently? Maybe that could be easily added?
> >
> > We have window-text-pixel-size, isn't that what you want?
> 
> But that can't be used in a pixel specification, as far as I understand?

I meant to suggest to use that function to compute the pixel value for
the :align-to spec.

> And anyway, I don't think that's right - as the Elisp manual says,
> "window-text-pixel-size treats the text displayed in a window as a whole
> and does not care about the size of individual lines."

That's a surprising interpretation.  The function accepts FROM and TO
arguments; if those are the beginning and the end of a line, you get
the pixel with of that line and nothing else.

> > E.g., are you planning on centering each line separately, or
> > everything together, or something else?
> 
> Each line separately.

So each line should have a different value of :align-to?

> > IOW, how did you envision you'd put the display property on each line?
> 
> The same display property would be applied to every line.

This contradicts my understanding from above, or what am I missing?

> > and how does this work when the user types text to add more lines, or
> > make a line longer than the window? etc. etc.
> 
> When they add more lines, those new lines are also centered.  If a line
> is longer than the window, it's truncated or wrapped depending on
> truncate-lines, word-wrap, etc., as usual.

If the lines are wrapped, you'd want the continuation line to be
centered as well?

And if we go one level higher, I guess you intend to write a
post-command-hook that recalculates the :align-to specs whenever text
changes, is that right?  Or how did you plan on taking text changes
into consideration?



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-13 20:49       ` sbaugh
  2021-04-14  6:56         ` Eli Zaretskii
@ 2021-04-14  8:28         ` martin rudalics
  1 sibling, 0 replies; 19+ messages in thread
From: martin rudalics @ 2021-04-14  8:28 UTC (permalink / raw)
  To: sbaugh, emacs-devel

 > The behavior I want is what's described here:
 > https://en.wikipedia.org/wiki/Typographic_alignment#Centered

I think the below should do most of what's needed.


(defun center-after-text-change (begin end _length)
   "..."
   (save-excursion
     (let ((from (progn (goto-char begin) (line-beginning-position)))
	  (to (progn (goto-char end) (line-beginning-position 2))))
       (center-region from to))))

(defun center-after-window-change (window)
   "..."
   (with-current-buffer (window-buffer window)
     (setq fill-column (window-body-width window))
     (center-region (window-start window) (window-end window))))

(with-current-buffer (get-buffer-create "*text*")
   (add-hook 'after-change-functions #'center-after-text-change 0 t)
   (add-hook 'window-state-change-functions #'center-after-window-change 0 t))

(switch-to-buffer "*text*")


But if you insist on handling variable-pitch text, things will get
expensive.

martin



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-14  6:56         ` Eli Zaretskii
@ 2021-04-14 13:28           ` sbaugh
  2021-04-14 13:42             ` Yuan Fu
                               ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: sbaugh @ 2021-04-14 13:28 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:
>> > E.g., are you planning on centering each line separately, or
>> > everything together, or something else?
>> 
>> Each line separately.
>
> So each line should have a different value of :align-to?

If they each had a different value of :align-to, then I'd have to update
those values of align-to every time text size or window size changes,
which is something I want to avoid.

> And if we go one level higher, I guess you intend to write a
> post-command-hook that recalculates the :align-to specs whenever text
> changes, is that right?  Or how did you plan on taking text changes
> into consideration?

No, I want my :align-to specs to stay the same as text changes.  If
that's not possible with :align-to specs, then I'd use some other
feature to implement the centering.

As I mentioned in my initial email, it's entirely possible to center
text in Emacs today, even by just inserting spaces.  But that doesn't
update automatically when text or window size changes; those spaces (or
:align-to specs, in your proposal - they're basically the same) need to
be updated by Lisp code running in post-command-hook or elsewhere, as
you say.

I want this centering display to be handled by the display engine, as
other similar things are.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-14 13:28           ` sbaugh
@ 2021-04-14 13:42             ` Yuan Fu
  2021-04-14 14:04             ` Stefan Monnier
  2021-04-14 14:42             ` Eli Zaretskii
  2 siblings, 0 replies; 19+ messages in thread
From: Yuan Fu @ 2021-04-14 13:42 UTC (permalink / raw)
  To: sbaugh; +Cc: emacs-devel



> On Apr 14, 2021, at 9:28 AM, sbaugh@catern.com wrote:
> 
> Eli Zaretskii <eliz@gnu.org> writes:
>>>> E.g., are you planning on centering each line separately, or
>>>> everything together, or something else?
>>> 
>>> Each line separately.
>> 
>> So each line should have a different value of :align-to?
> 
> If they each had a different value of :align-to, then I'd have to update
> those values of align-to every time text size or window size changes,
> which is something I want to avoid.
> 
>> And if we go one level higher, I guess you intend to write a
>> post-command-hook that recalculates the :align-to specs whenever text
>> changes, is that right?  Or how did you plan on taking text changes
>> into consideration?
> 
> No, I want my :align-to specs to stay the same as text changes.  If
> that's not possible with :align-to specs, then I'd use some other
> feature to implement the centering.
> 
> As I mentioned in my initial email, it's entirely possible to center
> text in Emacs today, even by just inserting spaces.  But that doesn't
> update automatically when text or window size changes; those spaces (or
> :align-to specs, in your proposal - they're basically the same) need to
> be updated by Lisp code running in post-command-hook or elsewhere, as
> you say.
> 
> I want this centering display to be handled by the display engine, as
> other similar things are.
> 
> 

Instead of post-command-hook, you can use jit-lock: register a function that updates the display spec when text changes. That works fine in my experience. I don’t think the display engine can do what you want.

Yuan




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-14 13:28           ` sbaugh
  2021-04-14 13:42             ` Yuan Fu
@ 2021-04-14 14:04             ` Stefan Monnier
  2021-04-14 15:22               ` sbaugh
  2021-04-14 14:42             ` Eli Zaretskii
  2 siblings, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2021-04-14 14:04 UTC (permalink / raw)
  To: sbaugh; +Cc: emacs-devel

> I want this centering display to be handled by the display engine, as
> other similar things are.

Another way to say it is that you want it to work even when the buffer
is displayed simultaneously in two different windows of different sizes
and using different default faces.

The current display engine doesn't know how to do that.  While I'm not
personally very interested in centering text in the window, I'd be very
happy to see improvements in this area of the display engine (the part
I'm interested in is for tabular display where :align-to doesn't really
work for right-aligned columns).


        Stefan




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-14 13:28           ` sbaugh
  2021-04-14 13:42             ` Yuan Fu
  2021-04-14 14:04             ` Stefan Monnier
@ 2021-04-14 14:42             ` Eli Zaretskii
  2021-04-14 15:25               ` sbaugh
  2 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2021-04-14 14:42 UTC (permalink / raw)
  To: sbaugh; +Cc: emacs-devel

> From: sbaugh@catern.com
> Date: Wed, 14 Apr 2021 09:28:53 -0400
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> >> > E.g., are you planning on centering each line separately, or
> >> > everything together, or something else?
> >> 
> >> Each line separately.
> >
> > So each line should have a different value of :align-to?
> 
> If they each had a different value of :align-to, then I'd have to update
> those values of align-to every time text size or window size changes,
> which is something I want to avoid.

No, you only need to update them when the length of some of the lines
changes.  That is why the values are different for each line: the
lines will usually have different lengths, and that length is part of
the value of :align-to.  Right?

> > And if we go one level higher, I guess you intend to write a
> > post-command-hook that recalculates the :align-to specs whenever text
> > changes, is that right?  Or how did you plan on taking text changes
> > into consideration?
> 
> No, I want my :align-to specs to stay the same as text changes.

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.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-14 14:04             ` Stefan Monnier
@ 2021-04-14 15:22               ` sbaugh
  0 siblings, 0 replies; 19+ messages in thread
From: sbaugh @ 2021-04-14 15:22 UTC (permalink / raw)
  To: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I want this centering display to be handled by the display engine, as
>> other similar things are.
>
> Another way to say it is that you want it to work even when the buffer
> is displayed simultaneously in two different windows of different sizes
> and using different default faces.

Ah, yes, precisely!

> The current display engine doesn't know how to do that.  While I'm not
> personally very interested in centering text in the window, I'd be very
> happy to see improvements in this area of the display engine (the part
> I'm interested in is for tabular display where :align-to doesn't really
> work for right-aligned columns).

Hmm... is there a single change that would allow both that and the
text-centering I want?




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-14 14:42             ` Eli Zaretskii
@ 2021-04-14 15:25               ` sbaugh
  2021-04-14 15:52                 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: sbaugh @ 2021-04-14 15:25 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:
> No, you only need to update them when the length of some of the lines
> changes.  That is why the values are different for each line: the
> lines will usually have different lengths, and that length is part of
> the value of :align-to.  Right?

Oh, that's true, I only need to update them when the length of the line
changes.

>> > And if we go one level higher, I guess you intend to write a
>> > post-command-hook that recalculates the :align-to specs whenever text
>> > changes, is that right?  Or how did you plan on taking text changes
>> > into consideration?
>> 
>> No, I want my :align-to specs to stay the same as text changes.
>
> 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.  Arbitrary function calls is
not necessary for what I want, just something specifically for the width
of the current line, in the same way there's already elements for
left-fringe etc.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-14 15:25               ` sbaugh
@ 2021-04-14 15:52                 ` Eli Zaretskii
  0 siblings, 0 replies; 19+ messages in thread
From: Eli Zaretskii @ 2021-04-14 15:52 UTC (permalink / raw)
  To: sbaugh; +Cc: emacs-devel

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



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
@ 2021-04-15  5:13 Paul W. Rankin via Emacs development discussions.
  2021-04-15  7:04 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Paul W. Rankin via Emacs development discussions. @ 2021-04-15  5:13 UTC (permalink / raw)
  To: sbaugh; +Cc: Eli Zaretskii, emacs-devel

> From: sbaugh@catern.com
> Date: Wed, 14 Apr 2021 11:25:41 -0400
>
> 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 apologise in advance if I've misunderstood your aims, but you can use the
line-prefix text property and compute the value of :align-to based on the line
width and the window text width:

(defun center-align-line ()
  (let (line-width align-col)
    (setq line-width (- (line-end-position)
                        (line-beginning-position)))
    (setq align-col (/ (- (window-body-width) line-width)
                       2))
    (put-text-property (line-beginning-position)
                       (line-end-position)
                       'line-prefix
                       `(space :align-to ,align-col))))

Achieving this dynamically is dependent upon your major mode; if you're using a
markup syntax, you could use font-lock and a regular expression, or if manually
applied you could use a text property flag.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-15  5:13 Horizontal centering in the display engine Paul W. Rankin via Emacs development discussions.
@ 2021-04-15  7:04 ` Eli Zaretskii
  2021-04-15 11:39   ` Paul W. Rankin via Emacs development discussions.
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2021-04-15  7:04 UTC (permalink / raw)
  To: Paul W. Rankin; +Cc: sbaugh, emacs-devel

> From: "Paul W. Rankin" <pwr@bydasein.com>
> Date: Thu, 15 Apr 2021 15:13:43 +1000
> Cc: Eli Zaretskii <eliz@gnu.org>,
>  emacs-devel@gnu.org
> 
> (defun center-align-line ()
>   (let (line-width align-col)
>     (setq line-width (- (line-end-position)
>                         (line-beginning-position)))

This calculation of line-width is, of course, only valid when there's
a single face used by the line's characters.

Using window-text-pixel-size will produce more accurate results, but
OP's main problem is not how to compute the line's width, it is how to
make the alignment adjust itself automatically to any changes in the
line's text and in the window's width.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-15  7:04 ` Eli Zaretskii
@ 2021-04-15 11:39   ` Paul W. Rankin via Emacs development discussions.
  2021-04-15 12:43     ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Paul W. Rankin via Emacs development discussions. @ 2021-04-15 11:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: sbaugh, emacs-devel

On 2021-04-15 17:04, Eli Zaretskii wrote:
> This calculation of line-width is, of course, only valid when there's
> a single face used by the line's characters.
> 
> Using window-text-pixel-size will produce more accurate results, but
> OP's main problem is not how to compute the line's width, it is how to
> make the alignment adjust itself automatically to any changes in the
> line's text and in the window's width.

Yes, just a proof of concept, we need to leave some things for OP to 
find out themselves ;)

If implemented with font-lock, the properties will automatically update 
when the text is changed, and a hook can be added to 
window-size-change-functions for the window changing.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-15 11:39   ` Paul W. Rankin via Emacs development discussions.
@ 2021-04-15 12:43     ` Stefan Monnier
  2021-04-15 13:05       ` Paul W. Rankin via Emacs development discussions.
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2021-04-15 12:43 UTC (permalink / raw)
  To: Paul W. Rankin via Emacs development discussions.
  Cc: sbaugh, Eli Zaretskii, Paul W. Rankin

> If implemented with font-lock, the properties will automatically update when
> the text is changed, and a hook can be added to window-size-change-functions
> for the window changing.

That won't handle the case where the text is displayed in several
windows at the same time.


        Stefan




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Horizontal centering in the display engine
  2021-04-15 12:43     ` Stefan Monnier
@ 2021-04-15 13:05       ` Paul W. Rankin via Emacs development discussions.
  0 siblings, 0 replies; 19+ messages in thread
From: Paul W. Rankin via Emacs development discussions. @ 2021-04-15 13:05 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, Eli Zaretskii, sbaugh

On 2021-04-15 22:43, Stefan Monnier wrote:
> That won't handle the case where the text is displayed in several
> windows at the same time.

Sure, but it's a much narrower case than that; the same buffer needs to 
be displayed in multiple windows with different widths and displaying 
the same centred line. A buffer could still be scrolled to different 
positions and correctly display different centred lines (e.g. at 
beginning and end of buffer).



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-04-15 13:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15  5:13 Horizontal centering in the display engine Paul W. Rankin via Emacs development discussions.
2021-04-15  7:04 ` Eli Zaretskii
2021-04-15 11:39   ` Paul W. Rankin via Emacs development discussions.
2021-04-15 12:43     ` Stefan Monnier
2021-04-15 13:05       ` Paul W. Rankin via Emacs development discussions.
  -- strict thread matches above, loose matches on Subject: below --
2021-04-13 18:25 sbaugh
2021-04-13 18:39 ` Eli Zaretskii
2021-04-13 19:28   ` sbaugh
2021-04-13 19:43     ` Eli Zaretskii
2021-04-13 20:49       ` sbaugh
2021-04-14  6:56         ` Eli Zaretskii
2021-04-14 13:28           ` sbaugh
2021-04-14 13:42             ` Yuan Fu
2021-04-14 14:04             ` Stefan Monnier
2021-04-14 15:22               ` sbaugh
2021-04-14 14:42             ` Eli Zaretskii
2021-04-14 15:25               ` sbaugh
2021-04-14 15:52                 ` Eli Zaretskii
2021-04-14  8:28         ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).