From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Horizontal centering in the display engine Date: Wed, 14 Apr 2021 18:52:43 +0300 Message-ID: <83fszszwvo.fsf@gnu.org> References: <87fszuvy7p.fsf@catern.com> <83czuy112a.fsf@gnu.org> <877dl6vvax.fsf@catern.com> <83blai0y3i.fsf@gnu.org> <8735vtx62w.fsf@catern.com> <8335vt1hiw.fsf@gnu.org> <87tuo9uh9m.fsf@catern.com> <83k0p5ylkb.fsf@gnu.org> <87fszsvqfe.fsf@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20403"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: sbaugh@catern.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 14 18:29:49 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWiOj-0005FL-La for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Apr 2021 18:29:49 +0200 Original-Received: from localhost ([::1]:52522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWiOi-0005T9-D7 for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Apr 2021 12:29:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWhp4-0000ak-M1 for emacs-devel@gnu.org; Wed, 14 Apr 2021 11:52:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45944) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWhp4-0000ie-8C; Wed, 14 Apr 2021 11:52:58 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2745 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lWhp3-0001eB-IJ; Wed, 14 Apr 2021 11:52:58 -0400 In-Reply-To: <87fszsvqfe.fsf@catern.com> (sbaugh@catern.com) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268057 Archived-At: > 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.