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.bugs Subject: bug#52129: 29.0.50; Wish: Extend `:align-to center' to work on lines in buffer Date: Sat, 27 Nov 2021 13:25:13 +0200 Message-ID: <83r1b1zvqe.fsf@gnu.org> References: <83o86616m2.fsf@gnu.org> <834k7y0xjv.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26130"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52129@debbugs.gnu.org To: Arthur Miller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 27 12:26:27 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mqvqc-0006bC-QU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Nov 2021 12:26:26 +0100 Original-Received: from localhost ([::1]:54870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqvqb-0000Pe-EG for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Nov 2021 06:26:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqvqE-0000OY-V3 for bug-gnu-emacs@gnu.org; Sat, 27 Nov 2021 06:26:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqvqD-0005zw-RR for bug-gnu-emacs@gnu.org; Sat, 27 Nov 2021 06:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mqvqD-0006hq-Ol for bug-gnu-emacs@gnu.org; Sat, 27 Nov 2021 06:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Nov 2021 11:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52129 X-GNU-PR-Package: emacs Original-Received: via spool by 52129-submit@debbugs.gnu.org id=B52129.163801232525734 (code B ref 52129); Sat, 27 Nov 2021 11:26:01 +0000 Original-Received: (at 52129) by debbugs.gnu.org; 27 Nov 2021 11:25:25 +0000 Original-Received: from localhost ([127.0.0.1]:33066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqvpd-0006h0-B3 for submit@debbugs.gnu.org; Sat, 27 Nov 2021 06:25:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqvpb-0006eO-MP for 52129@debbugs.gnu.org; Sat, 27 Nov 2021 06:25:24 -0500 Original-Received: from [2001:470:142:3::e] (port=55592 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqvpT-0005kL-B7; Sat, 27 Nov 2021 06:25:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Z98FuiCkqZd2pHlXALQ/B+g4O0DhfjS25elKSe159S0=; b=Fvpom4fsqEeF xikknOsOZvBjmcJyvB8jWew4bq3sSv3dtvn9PA68rsLgZy+mLbkpRVs3kULlfpO+xV0+lbVcBgmuJ 9/ZLxa4xU51qDTCA4nVKjYSLjsAd2fcvfKd6vn2td5JCiAxSEptBB6NqXo04WoxT96QMClmAL7i92 OZ7YfX7oDm/dbeH28bGLmw/qBbrbbb6CUG8MXr+x+kA4LvxgKAxViSTQDTaZRr0SaiAuu60x+dbmJ pNfyVgW+ptTPIapIgqLopXd7eL5CzgklmIH6lWHXF2trHdvlffVTVpFeknDAtGQ6+FU2d6S4J5jIZ Nz8ZjMLNH4gOxdUgr7OYIg==; Original-Received: from [87.69.77.57] (port=3213 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqvpK-0003oy-4E; Sat, 27 Nov 2021 06:25:08 -0500 In-Reply-To: (message from Arthur Miller on Sat, 27 Nov 2021 12:06:19 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220901 Archived-At: > From: Arthur Miller > Cc: 52129@debbugs.gnu.org > Date: Sat, 27 Nov 2021 12:06:19 +0100 > > > No, I mean to put this property: > > > > 'display '(space :align-to center) > > > > on a space character (or any other character, which will not be > > displayed) that is prepended to the time-stamp-string you want to > > display. > > Aha, like this?: > > (defun evc--time () > (concat (propertize " " 'display '(space :align-to center)) > (propertize > (time-stamp-string " %H:%M") 'face evc--time-face))) > > That still seems to be dependanble on when the time string is inserted? Because > when I test to insert like this: > > (defun evc--update () > (let ((time (evc--time)) > (date (evc--date))) > (when (frame-live-p evc--frame) > (select-frame evc--frame)) > (with-current-buffer evc--buffer > (erase-buffer) > (insert time "\n" date) > (goto-char 1)))) > > the string is not centered correctly; there is ~70 pixels difference between > left and right margins. That's because it centers the first character of the string, not its middle character. > 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? > I guess there is a reason why it is made one char at a time. Simplicity and speed, I guess. But that's not for me to answer: I wasn't there when this was designed.