From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.bugs Subject: bug#52129: 29.0.50; Wish: Extend `:align-to center' to work on lines in buffer Date: Sun, 28 Nov 2021 00:40:30 +0100 Message-ID: References: <83o86616m2.fsf@gnu.org> <834k7y0xjv.fsf@gnu.org> <83r1b1zvqe.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30726"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 52129@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 28 00:41:16 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 1mr7Jj-0007nV-9b for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Nov 2021 00:41:16 +0100 Original-Received: from localhost ([::1]:59584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mr7Ji-00028G-2Q for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Nov 2021 18:41:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mr7JW-000288-KW for bug-gnu-emacs@gnu.org; Sat, 27 Nov 2021 18:41:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mr7JW-0002oa-Bx for bug-gnu-emacs@gnu.org; Sat, 27 Nov 2021 18:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mr7JW-0004Gc-34 for bug-gnu-emacs@gnu.org; Sat, 27 Nov 2021 18:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Arthur Miller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Nov 2021 23:41:02 +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.163805644016369 (code B ref 52129); Sat, 27 Nov 2021 23:41:02 +0000 Original-Received: (at 52129) by debbugs.gnu.org; 27 Nov 2021 23:40:40 +0000 Original-Received: from localhost ([127.0.0.1]:34703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mr7JA-0004Fx-1V for submit@debbugs.gnu.org; Sat, 27 Nov 2021 18:40:40 -0500 Original-Received: from mail-oln040092070106.outbound.protection.outlook.com ([40.92.70.106]:59042 helo=EUR03-AM5-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mr7J8-0004Fh-ED for 52129@debbugs.gnu.org; Sat, 27 Nov 2021 18:40:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JsX5RvZQeKNkzIYyTDQEPB3CmUpXBIXCnH/OOzVx1Cfl5kHScCqQrTq9e2eJ7e3Y80iUQKQ9D+ZXD/CUjWIUzA2svIEn6KUlRIR/355Rd9y4yB/1txQLZkaCiaKC6Wfe8z7Gs3TDdJ+rwzwea680wxN3NBoeh5nlQM8h7WelAF9PQwAz0ZZLdW0ZNgMsrxnjK3xyCII5itXJEkiSd5x5i9reOCWUYY+aA7VQKYHgZVR5JxG7RVVVj2D1SnSwmiKGAIZh924esRGs4apOKqCsBdd9TIcnLGMO/DCCh15wGBdcensA3QG5l0OxZHL6n1Xewcyy48k3TTiOM+1ipsnZsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vId30P1lKoIPoNwqQwecs2m5J3bP86oOaArqaWzRmz8=; b=AvpfBrVgGOgVmiqCmMW1MQJ1wsQfurklt5Iw0q8Uk2bmWqmAv2vCztj9jVVE4u4fhuZgfffA2U0q9OnwxKQXi9vw0A8M+QZakGQtIFcslz2enyFOOXwZsntGEqZW6SekbBkwhSOM5alb2QOSBS5WSeOFYtxuhbs6PE7S6b1BH28nj3hEUSEdzUOVX/pBE3uSpQNsnnLDGDavRXj/QxWEp958XhdWCsA1M4drMg+R6HIKU65D9GhOKKrzEfk8pFh9jqV3TsohS4XLYLlv7d/yD1SuXiP2AYNrp5dIJJd0saOicERgz1KHR4EWNjtkQ5ioAGinXEMKuO6L5fOFZYWNfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vId30P1lKoIPoNwqQwecs2m5J3bP86oOaArqaWzRmz8=; b=npgwdCT0BNQSBTYDvNwaRbWWcmt0c+g67paW84+hO1gKtLbi0sllngBILK61yXgtC5ccRjA6G9ZWuMe93xYXffEEFbGo5fJCsu7Mtfw6x96p/s7RKkCb0UDypBAU2Iao4LornC+FBVGLI6u8hDQ8KzPmJLFW61svYxJ3M1lZ6ygz95p/s1Y1aGumu8nrXNO7u1JrENPXGAw+3pcCEuMvWoR6993yyuR9JzSTlyPyehP8tlMErhT1Or5CJX7efZ6t4F+FXG4L4kRxMPKh4l+kVS4VAe4z+X19qP8hGpS9Zsb0lWjR/KPBMijYDgmuuViyzAsbzAzZJnYtMLU+h9sE4g== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB3633.eurprd09.prod.outlook.com (2603:10a6:208:17d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.20; Sat, 27 Nov 2021 23:40:32 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c05b:e2ca:5b8a:56d2]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c05b:e2ca:5b8a:56d2%9]) with mapi id 15.20.4734.023; Sat, 27 Nov 2021 23:40:32 +0000 In-Reply-To: <83r1b1zvqe.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 27 Nov 2021 13:25:13 +0200") X-TMN: [FpA00/x8UQT7p2wkeZPzjEbjg8ooIB4H] X-ClientProxiedBy: GV3P280CA0021.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::22) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87zgppi2vl.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by GV3P280CA0021.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.20 via Frontend Transport; Sat, 27 Nov 2021 23:40:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c0d7dcb5-dee1-47ff-a8c2-08d9b1ff4cdc X-MS-TrafficTypeDiagnostic: AM0PR09MB3633: X-Microsoft-Antispam: BCL:0; X-Microsoft-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Wvt3ULFSveAtFV6NeNbxyRbBxr0ZbJmd7FHRZwUmO5XmdgMjCQ9LwcVh+oa7/0AZ0PKvZnJYK71vsL4gYFHDOT/e54YdyrFiO5loTsPNu99E4gDpSLg1YG1RSvheV+Jn/MQphgPizQCnLguM1bW6YytInJ9exyM/4FaTLwKZGoEr+725480Pa/yQ3HUGCBBbnK2qJs4MgeZz/wQfBFA6kFEc3sS6gWjzA2gxZ9EI6uspW9vVlLzo4E1++S2KmZym96zyxN9F4AJUqRzFHTBKaarJhEG2Rj5UcLLBQjwlGf8c8+BqGLEXQtmxIc2IZZgr5eg56V6o5zZM3Ifr0P6lIm+ovmFhE4jB j/ZYcleYm/v/N6CAT7lbvHqmeS1CC59TcDvJXQB7iy1GQRN8tmvAxNyR0o7BXeXi0X3O1AY2LPID9GYB5XD9+eOvwvHSvuJD2c X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: c0d7dcb5-dee1-47ff-a8c2-08d9b1ff4cdc X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2021 23:40:31.9189 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB3633 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:220947 Archived-At: Eli Zaretskii writes: >> 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. That too; so you see, it is not as simple to get it right by just prepending a space with :align-to center property. >> 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.