unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 52129@debbugs.gnu.org
Subject: bug#52129: 29.0.50; Wish: Extend `:align-to center' to work on lines in buffer
Date: Sun, 28 Nov 2021 11:38:18 +0100	[thread overview]
Message-ID: <AM9PR09MB4977986F3609B0D8F0BCDC4896659@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <83fsrgyb33.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 28 Nov 2021 02:48:41 -0500")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Arthur Miller <arthur.miller@live.com>
>> Cc: 52129@debbugs.gnu.org
>> Date: Sun, 28 Nov 2021 00:40:30 +0100
>> 
>> > That's because it centers the first character of the string, not its
>> > middle character.
>> 
>> That too; so you see, it is not as simple to get it right by just prepending a
>> space with :align-to center property.
>
> We've been through this: you need to dynamically compute the pixel
> coordinate to align-to, as function of the string width.

Yes, I know. I just reflected further to say it wasn't "just" to add align-to
property but it needs more computations :).

But if you say it is one character at a time, and it is not much to do about it,
then it is not much more to be done about that.

>> >> Is there any way to make it aware of surrounding context, like entire line? Or
>> >> would that be too demanding computationally?
>> >
>> > I don't think I understand what you mean by "surrounding context", and
>> > what would it mean for it to "be aware" of it?
>> 
>> With context I meant simply the line, or at least part of the line to be
>> displayed. To be aware of it = to take it into consideration when displaying
>> line, so things like suggested would be possible.
>
> The display engine considers the line as a whole only when the entire
> screen line has been laid out, i.e. we get to a newline or the X
> coordinate is at the right edge of the window.  Before that, there's
> no information about the "line context".

So it would in principle mean, to render line twice, if such property would be
implemented, and that could be very expensive computation, so it is off the radar.





  reply	other threads:[~2021-11-28 10:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26 20:01 bug#52129: 29.0.50; Wish: Extend `:align-to center' to work on lines in buffer Arthur Miller
2021-11-27  5:59 ` Eli Zaretskii
2021-11-27  8:47   ` Arthur Miller
2021-11-27  9:15     ` Eli Zaretskii
2021-11-27 11:06       ` Arthur Miller
2021-11-27 11:25         ` Eli Zaretskii
2021-11-27 23:40           ` Arthur Miller
2021-11-28  7:48             ` Eli Zaretskii
2021-11-28 10:38               ` Arthur Miller [this message]
2021-11-29 15:59                 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9PR09MB4977986F3609B0D8F0BCDC4896659@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=52129@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).