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 17:42:28 +0300 Message-ID: <83k0p5ylkb.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4550"; 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 16:43:36 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 1lWgjv-00016y-Uf for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Apr 2021 16:43:35 +0200 Original-Received: from localhost ([::1]:54412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWgju-0007Zp-Se for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Apr 2021 10:43:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWgj8-0006gc-2z for emacs-devel@gnu.org; Wed, 14 Apr 2021 10:42:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44643) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWgj7-0003wP-S1; Wed, 14 Apr 2021 10:42:45 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2429 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lWgj7-0005Si-6s; Wed, 14 Apr 2021 10:42:45 -0400 In-Reply-To: <87tuo9uh9m.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:268049 Archived-At: > From: sbaugh@catern.com > Date: Wed, 14 Apr 2021 09:28:53 -0400 > > Eli Zaretskii 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.