From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Horizontal centering in the display engine Date: Wed, 14 Apr 2021 09:42:54 -0400 Message-ID: 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> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34920"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: sbaugh@catern.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 14 15:49:31 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 1lWftb-00090M-9v for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Apr 2021 15:49:31 +0200 Original-Received: from localhost ([::1]:48352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWfta-0001zi-Bb for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Apr 2021 09:49:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWfnM-0005az-07 for emacs-devel@gnu.org; Wed, 14 Apr 2021 09:43:04 -0400 Original-Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]:34630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWfnF-00041M-Vn for emacs-devel@gnu.org; Wed, 14 Apr 2021 09:43:03 -0400 Original-Received: by mail-qv1-xf29.google.com with SMTP id j3so9860255qvs.1 for ; Wed, 14 Apr 2021 06:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KeveUU5A2C6r3M0T0V/WfHuxOKCmzEeH/eR4952e7Dc=; b=JNI70lBAoFkPhEpUveOukspKCPEeauVhenahrtlwCq2aDbHHqUfuPO2QDHw7WLVZlj WPuDHTtHpnuCAQtPJKDAFEROSR0V3ucm0gjji1eGWjjCkKFPkSi1xEgSFm8ZGEWW7sHg PEUhqT8Q1maNZb8CTCgUMVN/XCMepPzjG8phamyywkv/Ox71TykQ3N2+JMdNP7V0Ma7E WB7IrGcdZULkmZZogY4d7PlivlqSMBRKtBBD8i6yOzbXIyTV2qh0eg0lkDs5kgBy73ew di9k4Hs/NSLlzvhpgMidLSR5VsPuefgN5QUP5weNRnXJW0KgdK6gjbFHMYM7nltfdLKJ p+Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KeveUU5A2C6r3M0T0V/WfHuxOKCmzEeH/eR4952e7Dc=; b=I3XbkSRg4/Vt3YRAOTGAIxaTyN3MiUjYPlx8GISFSyWnkWAYTuLJ37Fj5m0CRoCnAN qzKPWPSiai0IGTKR/cIMqZcC5d1yNY38rQ/9KhcpyS3nFVgONiZkaD8u71GEOvuu4l/i LRdXIZW7qVT4eE4HLa/uHekRdYcpu7R0ZgiQ6Q46gONDQMfojFqy4mFsVemxTxMLCZQW mGXEft8+ZUv657Mrov9pFDwTpA0+PmOMZ+i7Qoh/04NH3rZTzc3dknHrfuPHn40hG+Yc wawdUaQ6AxUidJyY3j25+IQmqM6V6F+t+oYhjqnWXuTk2qckFUlqI2qsuqMMtpp+cxWU Dwwg== X-Gm-Message-State: AOAM532nnyi3piq09YfKA57MUzTPMHmADRPJPCVzlt2fmuTqyrar4dNz sCjcMKr5lZiYHVsueqjNDozchmTTJxY= X-Google-Smtp-Source: ABdhPJyr7d2PhDPk4LwfLbfU9jZIzrE4hdzkStxJtn5/kqIbR9EsZWI9567gz01uw/i9ftZlddaoLA== X-Received: by 2002:a05:6214:204:: with SMTP id i4mr39057485qvt.47.1618407776233; Wed, 14 Apr 2021 06:42:56 -0700 (PDT) Original-Received: from ?IPv6:2601:98a:4102:3d80:c5a4:1427:5b77:c7a7? ([2601:98a:4102:3d80:c5a4:1427:5b77:c7a7]) by smtp.gmail.com with ESMTPSA id c23sm12153694qtm.46.2021.04.14.06.42.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Apr 2021 06:42:55 -0700 (PDT) In-Reply-To: <87tuo9uh9m.fsf@catern.com> X-Mailer: Apple Mail (2.3654.60.0.2.21) Received-SPF: pass client-ip=2607:f8b0:4864:20::f29; envelope-from=casouri@gmail.com; helo=mail-qv1-xf29.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:268043 Archived-At: > On Apr 14, 2021, at 9:28 AM, sbaugh@catern.com wrote: >=20 > Eli Zaretskii writes: >>>> E.g., are you planning on centering each line separately, or >>>> everything together, or something else? >>>=20 >>> Each line separately. >>=20 >> So each line should have a different value of :align-to? >=20 > 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. >=20 >> 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? >=20 > 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. >=20 > 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. >=20 > I want this centering display to be handled by the display engine, as > other similar things are. >=20 >=20 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=E2=80=99t think the display engine can do what you = want. Yuan