From unknown Wed Aug 20 04:11:44 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#62606 <62606@debbugs.gnu.org> To: bug#62606 <62606@debbugs.gnu.org> Subject: Status: [PATCH] function to align mode-line elements to right Reply-To: bug#62606 <62606@debbugs.gnu.org> Date: Wed, 20 Aug 2025 11:11:44 +0000 retitle 62606 [PATCH] function to align mode-line elements to right reassign 62606 emacs submitter 62606 hugo@heagren.com severity 62606 normal tag 62606 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 00:47:43 2023 Received: (at submit) by debbugs.gnu.org; 2 Apr 2023 04:47:43 +0000 Received: from localhost ([127.0.0.1]:38829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pipd0-0007ns-IA for submit@debbugs.gnu.org; Sun, 02 Apr 2023 00:47:43 -0400 Received: from lists.gnu.org ([209.51.188.17]:49992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pijhp-0003Nm-8I for submit@debbugs.gnu.org; Sat, 01 Apr 2023 18:28:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pijho-00033e-Ml for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 18:28:16 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pijhm-0002m3-Ji for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 18:28:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Type:Message-ID:Subject:To:From:Date:MIME-Version: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=0yszpcTSwM+XHSMKg+uZuGQ0iqm9tCkDCcSOFqXMoHk=; b=wCpMzHkrd5T/vfrYSqo60piJfS WYMkbLsbFQMxBvpZL/m1uQSRmlKApqz4YccZH7f2HUBcsVotbc90s05bWS+wpV5tvUcl6Uk54kJET ejtmVjfUnDnh9btf/tqXbn8eU10foh1QcKjIf0DB6hlvG10DkonXrjG1gbthhlb2L4s82dMZLbSWF WF9embtXkw3s234wz6TdvAiKUuMNsHx7hQOZeVQXmkLDFMmena2Vo1ihXtXG9K72ozMwXVJI/F8nt H1Mkheb6d8g8Xgf3nEI9DAchddc81Cz1iddKX48S4RmqLMcn/SAj0UsFOmIFG4Oof+XZ6I5AQI9NH fTs/E32Q==; Received: from [::1] (port=37808 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.96) (envelope-from ) id 1pijh4-00GvcD-1w for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 23:27:31 +0100 MIME-Version: 1.0 Date: Sat, 01 Apr 2023 23:27:31 +0100 From: hugo@heagren.com To: bug-gnu-emacs@gnu.org Subject: [PATCH] function to align mode-line elements to right User-Agent: Roundcube Webmail/1.5.2 Message-ID: X-Sender: hugo@heagren.com Content-Type: multipart/mixed; boundary="=_24881bbfb92ffd7312e7ba18a498982a" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: Received-SPF: pass client-ip=5.77.41.174; envelope-from=hugo@heagren.com; helo=whuk14.whukhost.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 02 Apr 2023 00:47:38 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=_24881bbfb92ffd7312e7ba18a498982a Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed I wanted to be able to right-align some elements of the mode-line. I used `tab-bar-format-align-right' as a base and modified it to work with the mode-line. The functin aligns to the right /fringe/ rather than the margin because some modes (e.g. [visual-fill-column-mode]) mess around the margin size, but the right-align should be unaffected by this. Patch attached. I want to know that the code is good before I do NEWS and docs etc. Obviously it would be useful to document this in info (elisp) Mode Line Variables and maybe in the `mode-line-format' docstring. Blue skies, Hugo [visual-fill-column-mode] --=_24881bbfb92ffd7312e7ba18a498982a Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Support-right-align-in-mode-line.patch Content-Disposition: attachment; filename=0001-Support-right-align-in-mode-line.patch; size=2418 RnJvbSAxOTRlYWQzNzE5M2ExMzQwNDBhYzNmOTA3MTk5Y2JhZTIwNTdlZmJiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBIdWdvIEhlYWdyZW4gPGh1Z29AaGVhZ3Jlbi5jb20+CkRhdGU6 IFNhdCwgM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gIChwcm9wZXJ0aXplICIgIiAnZGlzcGxheQorCQk7OyBU aGUgYHJpZ2h0JyBzcGVjIGRvZXNuJ3Qgd29yayBvbiBUVFkgZnJhbWVzCisJCTs7IHdoZW4gd2lu ZG93cyBhcmUgc3BsaXQgaG9yaXpvbnRhbGx5IChidWcjNTk2MjApCisJCShpZiAod2luZG93LXN5 c3RlbSkKKwkJICAgIGAoc3BhY2UgOmFsaWduLXRvICgtIHJpZ2h0LWZyaW5nZSAoLHJlc3Qtd2lk dGgpKSkKKwkJICBgKHNwYWNlIDphbGlnbi10byAoLCgtICh3aW5kb3ctcGl4ZWwtd2lkdGgpIHJl c3Qtd2lkdGgpKSkpKSkpCisKKyhkZWZ2YXIgbW9kZS1saW5lLWZvcm1hdC1yaWdodC1hbGlnbiAn KDpldmFsIChtb2RlLWxpbmUtZm9ybWF0LXJpZ2h0LWFsaWduKSkKKyAgIk1vZGUgbGluZSBjb25z dHJ1Y3QgdG8gcmlnaHQgYWxpZ24gYWxsIGZvbGxvd2luZyBjb25zdHJ1Y3RzLiIpCis7OzsjIyNh dXRvbG9hZAorKHB1dCAnbW9kZS1saW5lLWZvcm1hdC1yaWdodC1hbGlnbiAncmlza3ktbG9jYWwt dmFyaWFibGUgdCkKKwogKGRlZnVuIGJpbmRpbmdzLS1kZWZpbmUta2V5IChtYXAga2V5IGl0ZW0p CiAgICJEZWZpbmUgS0VZIGluIGtleW1hcCBNQVAgYWNjb3JkaW5nIHRvIElURU0gZnJvbSBhIG1l bnUuCiBUaGlzIGlzIGxpa2UgYGRlZmluZS1rZXknLCBidXQgaXQgdGFrZXMgdGhlIGRlZmluaXRp b24gZnJvbSB0aGUKLS0gCjIuMjAuMQoK --=_24881bbfb92ffd7312e7ba18a498982a-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 01:47:32 2023 Received: (at 62606) by debbugs.gnu.org; 2 Apr 2023 05:47:32 +0000 Received: from localhost ([127.0.0.1]:38996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piqYt-0001MU-Iv for submit@debbugs.gnu.org; Sun, 02 Apr 2023 01:47:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piqYr-0001M7-DZ for 62606@debbugs.gnu.org; Sun, 02 Apr 2023 01:47:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piqYl-0004Tx-Is; Sun, 02 Apr 2023 01:47:23 -0400 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=usR7J78GlmDoJvmuOZPdxQgMZzPvOJa3BqoiF/uUqyo=; b=Mzi+6D8NZ84c a2587cQKmIKfR5ClDEmxVAv1FLvlTnDR/y/rO4DFVk94nLwH3/5NRgXeAch10o0Mn8NXIZnMMwdkp Kfy0gqesFcBub+b1sC1O52p4VSbClTR7IES/M7YgNZhxFZqL65iHL0I361nn87N8/dtcZaRJIOFgI Q0ly2t6u0VLAPaDVjjKWJVAeXSiWAUUWshWyc8cHeqysO/UuUFwRuz+GA1MfXOpgP/5YPuyQfFGmF 7EuMXWApdwn98VV+2hPbJFPjFu3Wu/c0DwALcuglkD3ihgX/7RgwMKH6Y7UnOz4OpLAIeRmJaQo3Z V+tHcMrUNEmp/ZkxU5kdow==; Received: from [87.69.77.57] (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 1piqYk-0001B8-Ko; Sun, 02 Apr 2023 01:47:22 -0400 Date: Sun, 02 Apr 2023 08:47:40 +0300 Message-Id: <83355iygw3.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com In-Reply-To: (hugo@heagren.com) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 01 Apr 2023 23:27:31 +0100 > From: hugo@heagren.com > > I wanted to be able to right-align some elements of the mode-line. I > used `tab-bar-format-align-right' as a base and modified it to work with > the mode-line. Thanks. What would be the situations where the user could want this alignment? One possible issue with right alignment is that when the total size of the mode-line text changes (e.g., the mode lighter changes), the leftmost part of it will move horizontally, something that could be unpleasant and even annoying. Also, what happens if the mode-line text is longer than the window width. What are user expectations in that case, and does :align-to meet those expectations? > The functin aligns to the right /fringe/ rather than the margin because > some modes (e.g. [visual-fill-column-mode]) mess around the margin size, > but the right-align should be unaffected by this. This detail should not be hard-coded, IMO. It should be up to the calling Lisp program (or maybe even user option) whether the alignment is to the right margin or to the window edge. Also, did you test this when the fringe is inside the margins and the margins have non-zero width? > + (let* ((rest (cdr (memq 'mode-line-format-right-align > + mode-line-format))) > + (rest-str (format-mode-line rest)) > + (rest-width (string-pixel-width rest-str))) The call to string-pixel-width will significantly slow down redisplay of the mode line. I wonder whether this feature should be implemented in C instead, to avoid the slowdown. On the C level, we always know the actual width of the mode-line text, and can right-align it by prepending a stretch glyph of a suitable width. > + (propertize " " 'display > + ;; The `right' spec doesn't work on TTY frames > + ;; when windows are split horizontally (bug#59620) > + (if (window-system) ^^^^^^^^^^^^^^^^^^^ This should use display-graphic-p, not window-system. Did you test this in a session which has both GUI and TTY frames? From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 12:41:20 2023 Received: (at 62606) by debbugs.gnu.org; 2 Apr 2023 16:41:20 +0000 Received: from localhost ([127.0.0.1]:42495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj0lc-0000v3-1f for submit@debbugs.gnu.org; Sun, 02 Apr 2023 12:41:20 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:52407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj0lZ-0000ui-3g for 62606@debbugs.gnu.org; Sun, 02 Apr 2023 12:41:17 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 072AA40003; Sun, 2 Apr 2023 16:41:09 +0000 (UTC) From: Juri Linkov To: hugo@heagren.com Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: (hugo@heagren.com's message of "Sat, 01 Apr 2023 23:27:31 +0100") Organization: LINKOV.NET References: Date: Sun, 02 Apr 2023 19:19:01 +0300 Message-ID: <861ql2g0i2.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I wanted to be able to right-align some elements of the mode-line. I > used `tab-bar-format-align-right' as a base and modified it to work with > the mode-line. > > The functin aligns to the right /fringe/ rather than the margin because > some modes (e.g. [visual-fill-column-mode]) mess around the margin size, > but the right-align should be unaffected by this. Does this mean that currently `tab-bar-format-align-right' doesn't work with `visual-fill-column-mode'? Ok, I tried it out, and see no problems. > Patch attached. I want to know that the code is good before I do NEWS > and docs etc. Obviously it would be useful to document this in info > (elisp) Mode Line Variables and maybe in the `mode-line-format' > docstring. Thanks, everything works nicely when I tried your patch, but one change was needed: > + (let* ((rest (cdr (memq 'mode-line-format-right-align > + mode-line-format))) > + (rest-str (format-mode-line rest)) Here `format-mode-line' returns an empty string when `mode-line-format-right-align' was added in the middle of `mode-line-format'. For a strange reason, it expects that `mode-line-format' should start with a string. So everything is fine after replacing in your patch (rest-str (format-mode-line rest)) with (rest-str (format-mode-line (append '("") rest))) From debbugs-submit-bounces@debbugs.gnu.org Sat May 06 10:14:41 2023 Received: (at 62606) by debbugs.gnu.org; 6 May 2023 14:14:41 +0000 Received: from localhost ([127.0.0.1]:35497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvIgK-0002Jf-Re for submit@debbugs.gnu.org; Sat, 06 May 2023 10:14:41 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]:54506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvIgH-0002JL-AY for 62606@debbugs.gnu.org; Sat, 06 May 2023 10:14:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To: From:Date:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WdCkDaHZuCckJwrZrbuJN7jyjMdx6PDjhKZDZbGAj/A=; b=K+sIDnS5eXEeW1Za9eMNPrUJAJ EJ4sZx+qoJd6N6EWkhFGbGTe+8d4HPcK1ViU65V1QGDpnAyoyMOQCOKXN7GX/q21qrXZIgX9yvtAh 4nfJVkwxQWR4GC9LgxfvXjwEbvMaAT2LLf9xU+89Ge0dGSYrScbEmn1tzuiE18X6b0vMysnw+0UZ2 b+x4xvyhHl5CEBkO6sHLowOw7FetVXWSpzVpkzfnNNTmlAIwlCnSUIxKvr2uac8N1bhy1gK0sIOD+ c8hoav9/smHANagFaF7LLTRaezZflZrJCFN5J7mhTUVhfuLoEascyM5U4Kpwh8JOaCCplFcGtMzYA MCUVrvWw==; Received: from [::1] (port=45336 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.96) (envelope-from ) id 1pvIg5-00BeMP-1m; Sat, 06 May 2023 15:14:30 +0100 MIME-Version: 1.0 Date: Sat, 06 May 2023 15:14:24 +0100 From: hugo@heagren.com To: Eli Zaretskii Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: <83355iygw3.fsf@gnu.org> References: <83355iygw3.fsf@gnu.org> User-Agent: Roundcube Webmail/1.6.0 Message-ID: X-Sender: hugo@heagren.com Content-Type: multipart/mixed; boundary="=_0c7067c861114fa75502f588fe1f6415" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=_0c7067c861114fa75502f588fe1f6415 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Thanks for the feedback. A new patch is attached. > From: Eli Zaretskii > Date: Sun, 02 Apr 2023 08:47:40 +0300 > What would be the situations where the user could want this alignment? It's merely an aesthetic thing -- I just like having some of my information right-aligned. I think the motivation for the tab bar right-align function is similar? > One possible issue with right alignment is that when the total size of > the mode-line text changes (e.g., the mode lighter changes), the > leftmost part of it will move horizontally, something that could be > unpleasant and even annoying. This doesn't happen with my proposed setup (though I agree it would be annoying if it did!). The user includes the symbol `mode-line-format-right-align' in their mode line format. This is a variable which holds a mode-line construct `(:eval (mode-line-format-right-align))'. So whenever the mode-line is reloaded (and therefore, whenever the length could change), the space used to pad the right-aligned part to the right is recalculated. The only situation where this could go wrong would be if the length of the left part of the mode-line changed /during/ the process of reloading the mode-line, which seems unlikely to happen. > Also, what happens if the mode-line text is longer than the window > width. What are user expectations in that case, and does :align-to > meet those expectations? Then the text overflows to the right. The behaviour with my patch is the same as without: the text furthest to the right is not visible. The way the patch is written would mean that the padding used to align text to the right would be nil (i.e. a zero-width) string, but this is not really relevant because it won't be visible (because it will be off the right-hand edge of the screen). > > The functin aligns to the right /fringe/ rather than the margin because > > some modes (e.g. [visual-fill-column-mode]) mess around the margin size, > > but the right-align should be unaffected by this. > This detail should not be hard-coded, IMO. On reflection, I think you're right. > It should be up to the calling Lisp program (or maybe even user > option) whether the alignment is to the right margin or to the window > edge. I found this easier to implement as a user option -- I've added `mode-line-right-align-edge' to the patch. > Also, did you test this when the fringe is inside the margins and the > margins have non-zero width? Yes. It does exactly what you expect (i.e. if `mode-line-right-align-edge' is set to `right-fringe' then align to the fringe, it set to `right-margin' etc.). Setting `mode-line-right-align-edge' to `window' aligns to the right of the window even in these circumstances. > The call to string-pixel-width will significantly slow down redisplay > of the mode line. Yes, unfortunately. > I wonder whether this feature should be implemented in C instead, to > avoid the slowdown. This would be great, but I definitely don't have the skills to do it. Unless someone else does this, perhaps we could include my lisp implementation for now, document the slowness (in the docstring), and put a C implementation on the wishlist/TODO? > This should use display-graphic-p, not window-system. Fixed. > Did you test this in a session which has both GUI and TTY frames? Yes, it behaves correctly (i.e. right-aligns in both, even when the same buffer is simultaneously displayed in both). > From: Juri Linkov > Date: Sun, 02 Apr 2023 19:19:01 +0300 > Here `format-mode-line' returns an empty string when > `mode-line-format-right-align' was added in the middle of > `mode-line-format'. For a strange reason, it expects that > `mode-line-format' should start with a string. So everything is fine > after replacing in your patch Thanks for pointing this out. I've fixed it in the new patch (though my fix uses a back-quote construction, but the effect is the same). Hope the new version is better. Thoughts? --=_0c7067c861114fa75502f588fe1f6415 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Support-right-align-in-mode-line.patch Content-Disposition: attachment; filename=0001-Support-right-align-in-mode-line.patch; size=4513 RnJvbSA3NzBlMmEwNjE3YzY1MDc1NWYxYmUzZGUxNWZmYmUxM2E5NjY0YTUzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBIdWdvIEhlYWdyZW4gPGh1Z29AaGVhZ3Jlbi5jb20+CkRhdGU6 IFNhdCwgMSBBcHIgMjAyMyAyMjoyNzoyNSArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIFN1cHBvcnQg cmlnaHQtYWxpZ24gaW4gbW9kZS1saW5lCgoqIGxpc3AvYmluZGluZ3MuZWwgKG1vZGUtbGluZS1y aWdodC1hbGlnbi1lZGdlKTogIE5ldyBjdXN0b20gdmFyaWFibGUuCkNvbnRyb2xzIHdoZXJlIGBt b2RlLWxpbmUtZm9ybWF0LXJpZ2h0LWFsaWduJyBzaG91bGQgYWxpZ24gdG8uCihtb2RlLWxpbmUt Zm9ybWF0LXJpZ2h0LWFsaWduKTogIE5ldyBmdW5jdGlvbi4gIElmIHRoZSBzeW1ib2wKYG1vZGUt bGluZS1mb3JtYXQtcmlnaHQtYWxpZ24nIGFwcGVhcnMgaW4gYG1vZGUtbGluZS1mb3JtYXQnLCB0 aGVuCnJldHVybiByZXR1cm4gYSBwYWRkaW5nIHN0cmluZyB3aGljaCBhbGlnbnMgZXZlcnl0aGlu ZyBhZnRlciB0aGF0CnN5bWJvbCB0byB0aGUgcmlnaHQuICBQYWRkaW5nIHdpZHRoIGlzIGFsdG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scmVzdC13aWR0aCkpKQor CQkgIGAoc3BhY2UgOmFsaWduLXRvICgsKC0gKHdpbmRvdy1waXhlbC13aWR0aCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHdpbmRvdy1zY3JvbGwtYmFyLXdpZHRo KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAod2luZG93LXJpZ2h0 LWRpdmlkZXItd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICgqIChvciAoY2RyICh3aW5kb3ctbWFyZ2lucykpIDEpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChmcmFtZS1jaGFyLXdpZHRoKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgTWFudWFsbHkgYWNjb3VudCBmb3IgdmFsdWUg b2YKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgYG1vZGUtbGlu ZS1yaWdodC1hbGlnbi1lZGdlJyBldmVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDs7IHdoZW4gZGlzcGxheSBpcyBub24tZ3JhcGhpY2FsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwY2FzZSBtb2RlLWxpbmUtcmlnaHQtYWxpZ24t ZWRnZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgob3IgJ3Jp Z2h0ICdyaWdodC1tYXJnaW4pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChvciAoY2RyICh3aW5kb3ctbWFyZ2lucykpIDApKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICgncmlnaHQtZnJpbmdlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDs7IHdoYXQgaGVyZT8KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG9yIChjYWRyICh3aW5kb3ctZnJpbmdlcykp IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChfIDApKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN0LXdpZHRoKSkpKSkp KQorCisoZGVmdmFyIG1vZGUtbGluZS1mb3JtYXQtcmlnaHQtYWxpZ24gJyg6ZXZhbCAobW9kZS1s aW5lLWZvcm1hdC1yaWdodC1hbGlnbikpCisgICJNb2RlIGxpbmUgY29uc3RydWN0IHRvIHJpZ2h0 IGFsaWduIGFsbCBmb2xsb3dpbmcgY29uc3RydWN0cy4iKQorOzs7IyMjYXV0b2xvYWQKKyhwdXQg J21vZGUtbGluZS1mb3JtYXQtcmlnaHQtYWxpZ24gJ3Jpc2t5LWxvY2FsLXZhcmlhYmxlIHQpCisK IChkZWZ1biBiaW5kaW5ncy0tZGVmaW5lLWtleSAobWFwIGtleSBpdGVtKQogICAiRGVmaW5lIEtF WSBpbiBrZXltYXAgTUFQIGFjY29yZGluZyB0byBJVEVNIGZyb20gYSBtZW51LgogVGhpcyBpcyBs aWtlIGBkZWZpbmUta2V5JywgYnV0IGl0IHRha2VzIHRoZSBkZWZpbml0aW9uIGZyb20gdGhlCi0t IAoyLjIwLjEKCg== --=_0c7067c861114fa75502f588fe1f6415-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 06 10:39:14 2023 Received: (at 62606) by debbugs.gnu.org; 6 May 2023 14:39:14 +0000 Received: from localhost ([127.0.0.1]:35521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvJ45-0002yR-Mq for submit@debbugs.gnu.org; Sat, 06 May 2023 10:39:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvJ42-0002yB-2u for 62606@debbugs.gnu.org; Sat, 06 May 2023 10:39:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvJ3v-0004aH-Ux; Sat, 06 May 2023 10:39:03 -0400 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=5HCt5RI+YRn4mIg20WRMIUPQY47KrBwJCotwFu/wAiM=; b=TRkEsgfcK5Z+ yJiIN+Gd3PShbERz7OpMZoW/PC6emVuNXQA13hgBjNJRDJ1QwZBapDr8UUrGO/1t93XR767yFjqrU GTvnkctLWxl0AV1ab0xNRFurbHiuI0EFGHwoZl9ViFakeGnojebhKFqeALgt2JfSQE+to6e8fV8OV d8T0zISjX6I4AQJ9p9ULil6T8WLW6pM5L+bfQR0TH2dB+8nAjkqiROJ7rueBHfArRZYQT4dtRF0pv Dq2Xnt1KEosi9uM3J3tbZdvt7/BkGwPfS4xBznn2EdHGxl6zIem+8kGdNq8b/ZjPX2lpSO1fgl5vF WRvSm1HAyHf9jvFpe7cC4g==; Received: from [87.69.77.57] (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 1pvJ3v-0002el-F4; Sat, 06 May 2023 10:39:03 -0400 Date: Sat, 06 May 2023 17:39:59 +0300 Message-Id: <83mt2hfrr4.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com In-Reply-To: (hugo@heagren.com) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: <83355iygw3.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 06 May 2023 15:14:24 +0100 > From: hugo@heagren.com > Cc: 62606@debbugs.gnu.org > > > One possible issue with right alignment is that when the total size of > > the mode-line text changes (e.g., the mode lighter changes), the > > leftmost part of it will move horizontally, something that could be > > unpleasant and even annoying. > > This doesn't happen with my proposed setup (though I agree it would be > annoying if it did!). The user includes the symbol > `mode-line-format-right-align' in their mode line format. This is a > variable which holds a mode-line construct `(:eval > (mode-line-format-right-align))'. So whenever the mode-line is reloaded > (and therefore, whenever the length could change), the space used to pad > the right-aligned part to the right is recalculated. That recalculation is what I alluded to: the space will be different depending on the size of the mode-line text. > > Also, what happens if the mode-line text is longer than the window > > width. What are user expectations in that case, and does :align-to > > meet those expectations? > > Then the text overflows to the right. I'm not sure everyone will agree with your expectations. > > This should use display-graphic-p, not window-system. > > Fixed. > > > Did you test this in a session which has both GUI and TTY frames? > > Yes, it behaves correctly (i.e. right-aligns in both, even when the > same buffer is simultaneously displayed in both). And if then you delete all the GUI frames and only the TTY frames remain? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 16:45:26 2023 Received: (at 62606) by debbugs.gnu.org; 5 Jun 2023 20:45:27 +0000 Received: from localhost ([127.0.0.1]:50424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6H4w-0002eH-HR for submit@debbugs.gnu.org; Mon, 05 Jun 2023 16:45:26 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]:45452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6H4u-0002e2-De for 62606@debbugs.gnu.org; Mon, 05 Jun 2023 16:45:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=N9zA45jmLEjO3r2Ogr9aNJd76iXkUxm9FtNY+HUt2Jg=; b=E0QJyVDEBuanEYJY+vFFz36dMh mRh9PA5LRXCMqoedg8hacWfWulLMY3wo1/1NHvr0NJsMe4X6Jc9VPwpJh3rNuf8OM1T+pYaUM48JM jsXn4bY5+E+74Q7hThHnPYy8HmcZrJUGB5BiJMFji8fX1XdhpWXrPbZkIlWHsWOa+RHbJDyFdeYe9 2ZiA/tGdvW9POuNqJWscpzf4F1w/PPP92QwFs7DpEsRs+MrtEx9E14TzwKE0j0UXYg9CREDU/B8D6 oEGSOkbsGdrubievcLqCHGWUGpY49aPPl9dJwc1naQWW7rpCuJ/3nUNM/twhQ/AmOBZpa7jzdu/V0 Qni2v+hQ==; Received: from [::1] (port=42154 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.96) (envelope-from ) id 1q6H4n-003IBY-2U; Mon, 05 Jun 2023 21:45:17 +0100 MIME-Version: 1.0 Date: Mon, 05 Jun 2023 21:45:17 +0100 From: hugo@heagren.com To: Eli Zaretskii Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: <83mt2hfrr4.fsf@gnu.org> References: <83355iygw3.fsf@gnu.org> <83mt2hfrr4.fsf@gnu.org> User-Agent: Roundcube Webmail/1.6.0 Message-ID: <4b872ecc12e3995d5b7dfffa580e297d@heagren.com> X-Sender: hugo@heagren.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2023-05-06 15:39, Eli Zaretskii wrote: > > > One possible issue with right alignment is that when the total size of > > > the mode-line text changes (e.g., the mode lighter changes), the > > > leftmost part of it will move horizontally, something that could be > > > unpleasant and even annoying. > > > > This doesn't happen with my proposed setup (though I agree it would be > > annoying if it did!). The user includes the symbol > > `mode-line-format-right-align' in their mode line format. This is a > > variable which holds a mode-line construct `(:> eval > > (mode-line-format-right-align))'. So whenever the mode-line is reloaded > > (and therefore, whenever the length could change), the space used to pad > > the right-aligned part to the right is recalculated. > > That recalculation is what I alluded to: the space will be different > depending on the size of the mode-line text. I confess I am very confused. Let's say we have a modeline like this, with parts L (left-aligned), M (middle - displays as empty space) and R (right-aligned): |--L--|-------M-------|-R-| Foo bar X If L gets longer then: - M will get shorter - R will stay the same So we get: |--L-----|----M-------|-R-| Foo barrrr X Is this what you're worried about? If so, I don't think it's much of a cause for concern. I modelled my function on `tab-bar-format-align-right', which works in a very similar way. It also strikes me that something like this happens anyway already: if we have a mode-line with just a left-aligned lighter, and the lighter gets longer (or shorter), then the space between the end of the lighter and the edge of the screen (i.e. M+R) gets smaller (or bigger). Isn't this to be expected? If this isn't the effect you're worried about, could you explain in more detail? > > > Also, what happens if the mode-line text is longer than the window > > > width. What are user expectations in that case, and does :align-to > > > meet those expectations? > > > > Then the text overflows to the right. > > I'm not sure everyone will agree with your expectations. The only alternative I can think of is that the right-aligned part stay visible, and the other text overflows 'behind' it. Personally I don't think this would make much sense, but I can see that some people might prefer it. I suppose the best thing to do would be to add an option to control the behaviour, but I've had a look at the code and I have no idea how to implement the other version---the current behaviour is what happens by default and it just seemed right to me. > > > This should use display-graphic-p, not window-system. > > > > Fixed. > > > > > Did you test this in a session which has both GUI and TTY frames? > > > > Yes, it behaves correctly (i.e. right-aligns in both, even when the > > same buffer is simultaneously displayed in both). > > And if then you delete all the GUI frames and only the TTY frames > remain? Same effect -- the right-aligned part is still right-aligned in the remaining TTY frames. Hope that helps. Hugo From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 06 07:24:37 2023 Received: (at 62606) by debbugs.gnu.org; 6 Jun 2023 11:24:37 +0000 Received: from localhost ([127.0.0.1]:51069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6Unl-0004dZ-4C for submit@debbugs.gnu.org; Tue, 06 Jun 2023 07:24:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6UnZ-0004d8-ET for 62606@debbugs.gnu.org; Tue, 06 Jun 2023 07:24:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6UnT-0003qF-Fk; Tue, 06 Jun 2023 07:24:19 -0400 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=96+PC7Tupxs02lhb/JXWm+i0tWQKRe9qx9BMIgWrQIg=; b=cgM4zs+vbC9U IlUHpgP0jXF9wF/ghH65G4fhR9gxWxEYk+pWVt721cpfpebRpmMEg72SKlVY+kiL0Sm/yyOXBOYs+ zAYlToP9RcplGJvvE10v4lY0miuVOgDB9WL5nVRjpgR/pQZW4TJzj9akN7yHgGRsLuduu8o1GlgLD 6B+tcAoXgj88Ug4N094/y/rvqPombLjd7VLPck3f5Q9Kb7/YyGZv2epYKYghFroueMAxCEcYpCVaU HLlgQUIS23KvYfPvJa1rbaXgoTBM+Q5VOGJyja9xVee/z8Y9r277F9BgpOiOKLqcWGKB5lXzFIxTI dBmpOVeXL4blj8+vSzWB0g==; Received: from [87.69.77.57] (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 1q6UnN-000880-Fk; Tue, 06 Jun 2023 07:24:19 -0400 Date: Tue, 06 Jun 2023 14:24:11 +0300 Message-Id: <83zg5c3kbo.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com In-Reply-To: <4b872ecc12e3995d5b7dfffa580e297d@heagren.com> (hugo@heagren.com) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: <83355iygw3.fsf@gnu.org> <83mt2hfrr4.fsf@gnu.org> <4b872ecc12e3995d5b7dfffa580e297d@heagren.com> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 05 Jun 2023 21:45:17 +0100 > From: hugo@heagren.com > Cc: 62606@debbugs.gnu.org > > On 2023-05-06 15:39, Eli Zaretskii wrote: > > > > One possible issue with right alignment is that when the total size of > > > > the mode-line text changes (e.g., the mode lighter changes), the > > > > leftmost part of it will move horizontally, something that could be > > > > unpleasant and even annoying. > > > > > > This doesn't happen with my proposed setup (though I agree it would be > > > annoying if it did!). The user includes the symbol > > > `mode-line-format-right-align' in their mode line format. This is a > > > variable which holds a mode-line construct `(:> eval > > > (mode-line-format-right-align))'. So whenever the mode-line is reloaded > > > (and therefore, whenever the length could change), the space used to pad > > > the right-aligned part to the right is recalculated. > > > > That recalculation is what I alluded to: the space will be different > > depending on the size of the mode-line text. > > I confess I am very confused. Let's say we have a modeline like this, > with parts L (left-aligned), M (middle - displays as empty space) and R > (right-aligned): > > |--L--|-------M-------|-R-| > Foo bar X > > If L gets longer then: > - M will get shorter > - R will stay the same > > So we get: > |--L-----|----M-------|-R-| > Foo barrrr X > > Is this what you're worried about? If so, I don't think it's much of a > cause for concern. No, I was talking about the case where the R part becomes longer. > I modelled my function on > `tab-bar-format-align-right', which works in a very similar way. IMNSHO, that mopdel is not the ideal one. > It also > strikes me that something like this happens anyway already: if we have a > mode-line with just a left-aligned lighter, and the lighter gets longer > (or > shorter), then the space between the end of the lighter and the edge of > the screen (i.e. M+R) gets smaller (or bigger). Isn't this to be > expected? Yes. But with left alignment the beginning of the text never moves, only the end. With right alignment, the beginning moves. It's jarring, IMO. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 09 08:48:04 2023 Received: (at 62606) by debbugs.gnu.org; 9 Jun 2023 12:48:04 +0000 Received: from localhost ([127.0.0.1]:58549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7bXA-0000gl-6m for submit@debbugs.gnu.org; Fri, 09 Jun 2023 08:48:04 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]:45418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7bX8-0000fm-M0 for 62606@debbugs.gnu.org; Fri, 09 Jun 2023 08:48:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8jECR7dtkW2JTEDiy+aM4agskKpDqVZaPRe+oRegIkE=; b=bA8rv5cJY/qnQImhHiaCoh1c+2 ip6+CcSYAiardRYBHXtr9UcUTJ1xbg02swiZtSDTAVIhGw8rxDGS5lyvcZD3Y0BVHJiUl7pL2VxH3 AXalQjL6Q3B/GxWdn6lgtnJMfUrEyLsu82581AENeCgfSAWerLetXuxFIREfqSzJ2lH1p1LD2BmYm Y9zsiPssGNH+iLlDLBlWHBpKjvT24pCMiJUfYw4AI0pNhOfVsqb15TQtefikN2PeXjkE3ZWZboa2m NHDoLCpBbA+LEuUiKKSyFNzxgYYwkk2BblmTJwLFUEXL7Wai4Ja9fFKvg4dLpOLyrSvJWfDL7Wbpt V8n8f2+w==; Received: from [::1] (port=52948 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.96) (envelope-from ) id 1q7bX1-00BJXW-35; Fri, 09 Jun 2023 13:47:55 +0100 MIME-Version: 1.0 Date: Fri, 09 Jun 2023 13:47:55 +0100 From: hugo@heagren.com To: Eli Zaretskii Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: <83zg5c3kbo.fsf@gnu.org> References: <83355iygw3.fsf@gnu.org> <83mt2hfrr4.fsf@gnu.org> <4b872ecc12e3995d5b7dfffa580e297d@heagren.com> <83zg5c3kbo.fsf@gnu.org> User-Agent: Roundcube Webmail/1.6.0 Message-ID: X-Sender: hugo@heagren.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2023-06-06 12:24, Eli Zaretskii wrote: > No, I was talking about the case where the R part becomes longer. I see now. So you're worried about the difference between these two: |L|-------M-----|--R--| X Foo Bar |L|-------M---|---R---| X Foo Barrr And how `Foo' moves left in the second case. I understand. >> I modelled my function on >> `tab-bar-format-align-right', which works in a very similar way. > > IMNSHO, that mopdel is not the ideal one. I'm not sure what you mean? If you're talking about what the function /does/, isn't this just a matter of preference? You might not like using it, but I /do/ like it. I wanted a function which does exactly what that function does, but for the modeline. I find the way it displays information perfectly natural. Clearly enough other people also do that the tab-bar equivalent was worth building and using. If you're talking about the internals, could you explain a bit more? > Yes. But with left alignment the beginning of the text never moves, > only the end. With right alignment, the beginning moves. It's > jarring, IMO. Right, I see. But that's only true of the text as a whole isn't it? Consider a modeline with two constructs, FOO and BAR: '(FOO " " BAR). Both are left aligned. Say FOO prints "foo" and BAR prints "bar", so we have: foo bar If FOO now prints something longer (e.g. "foooooooo", the beginning of the BAR part will move, thus: foo bar -----> foooooooo bar So with left aligned text, sometimes the beginning (of some piece of information) moves as well). This happens for real if FOO is something like the buffer name -- BAR will move whenever we switch to a buffer with a name of a different length. I think if people who want left-aligned text can put up with this, then people who want right-aligned text will probably put up with the equivalent problem. In fact, it was precisely /because/ of this kind of situation, that I originally wanted to right-align some of my information, so that it /wouldn't/ move when elements to the left of it changed length. By right-aligning, I can completely control the space between them. Overall, I can see that this isn't a feature you like, and probably not one you would use either, but it's similar enough (in function and in problems) to other stuff already in Emacs that it seems pretty reasonable to me. best, Hugo From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 09 09:13:06 2023 Received: (at 62606) by debbugs.gnu.org; 9 Jun 2023 13:13:06 +0000 Received: from localhost ([127.0.0.1]:58589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7bvO-0001Lz-EO for submit@debbugs.gnu.org; Fri, 09 Jun 2023 09:13:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7bvM-0001LT-IC for 62606@debbugs.gnu.org; Fri, 09 Jun 2023 09:13:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7bvG-0007SF-Uf; Fri, 09 Jun 2023 09:12:58 -0400 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=w+W8cbqcr0brrXer6zLFuzTHW8OFsVrWhjQLONOIWUs=; b=gOsdE5G98e42 pjf0jxXh0nIrtlpJly5xk2uRQM5qjCtnd97rZmAwymFoH9bGCp2QyEKHk5lJSfANz7FgpUYJD7GEK bBw3c0KQGznCe8N36RRpExBARUHrlgQSy4q8Hz6CBLPPJtCFuWpmVwmq5rjppEOSkXgJjfivPT2Wr EFdZbLbSuUiWe8VDJH+og13AIPGsML4sr4BkEO1dSu3APpEz8X/v+AEpf6dlyTRG6qDKEAmvov33k CLyzBXVD9DnGik6zxh8I2px14gOT52jYCCDNtWm+kcrBFqPUd4FmcCcqzmABM/rznXs9XRQ8qyWL0 TLJluZvxNbF3rfo5TNGnPw==; Received: from [87.69.77.57] (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 1q7bvG-0008ME-DX; Fri, 09 Jun 2023 09:12:58 -0400 Date: Fri, 09 Jun 2023 16:13:06 +0300 Message-Id: <83ilbw22zh.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com In-Reply-To: (hugo@heagren.com) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: <83355iygw3.fsf@gnu.org> <83mt2hfrr4.fsf@gnu.org> <4b872ecc12e3995d5b7dfffa580e297d@heagren.com> <83zg5c3kbo.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 09 Jun 2023 13:47:55 +0100 > From: hugo@heagren.com > Cc: 62606@debbugs.gnu.org > > On 2023-06-06 12:24, Eli Zaretskii wrote: > >> I modelled my function on > >> `tab-bar-format-align-right', which works in a very similar way. > > > > IMNSHO, that mopdel is not the ideal one. > > I'm not sure what you mean? If you're talking about what the function > /does/, isn't this just a matter of preference? You might not like using > it, but I /do/ like it. I wanted a function which does exactly what that > function does, but for the modeline. I find the way it displays > information perfectly natural. Clearly enough other people also do that > the tab-bar equivalent was worth building and using. If you're talking > about the internals, could you explain a bit more? Put mildly, the implementation is IMO very complicated, and hard to follow and maintain/develop. > > Yes. But with left alignment the beginning of the text never moves, > > only the end. With right alignment, the beginning moves. It's > > jarring, IMO. > > Right, I see. But that's only true of the text as a whole isn't it? > Consider a modeline with two constructs, FOO and BAR: '(FOO " " BAR). > Both are left aligned. Say FOO prints "foo" and BAR prints "bar", so we > have: > > foo bar > > If FOO now prints something longer (e.g. "foooooooo", the beginning of > the > BAR part will move, thus: > > foo bar > -----> > foooooooo bar > > So with left aligned text, sometimes the beginning (of some piece of > information) moves as well). This happens for real if FOO is something > like the buffer name -- BAR will move whenever we switch to a buffer > with a name of a different length. I think if people who want > left-aligned text can put up with this, then people who want > right-aligned text will probably put up with the equivalent problem. Yes, but with the current mode-line structure, we take care to prevent that by leaving enough padding for the extra text to have space, before it starts shifting what's after it. With right-alignment, that's harder to accomplish. > In fact, it was precisely /because/ of this kind of situation, that I > originally wanted to right-align some of my information, so that it > /wouldn't/ move when elements to the left of it changed length. By > right-aligning, I can completely control the space between them. You can accomplish that by padding, even without right-alignment, I think. > Overall, I can see that this isn't a feature you like, and probably not > one you would use either, but it's similar enough (in function and in > problems) to other stuff already in Emacs Sadly. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 09 10:52:33 2023 Received: (at 62606) by debbugs.gnu.org; 9 Jun 2023 14:52:33 +0000 Received: from localhost ([127.0.0.1]:60012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7dTd-0004Pv-7N for submit@debbugs.gnu.org; Fri, 09 Jun 2023 10:52:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7dTa-0004Pi-Vm for 62606@debbugs.gnu.org; Fri, 09 Jun 2023 10:52:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7dTT-0000zO-W9; Fri, 09 Jun 2023 10:52:24 -0400 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=SY5ACzveidzG8DSp3OiJV/iHBrJoiV2CLQWbQihqTAs=; b=Pq06f84MKepe BPyvtsZWzdGx3iW8FfHbIVPyIieHz+a8oseSAtFe4A6aBCXpZ/WBXK/CBxeU5iyRuwP8ySMG1xGkP dTwhLSqCJwfF4xb/77VRWb2V25q1GqGDJZP3kDabgNefcZUJgVJ/Fwi84Z8eWa7ytTiypk4HHfK2s SdywrdIm3HPKcyLKwmTqF5UtK+VUMBVPXBxE2tiAXx8tfJ1dYspuIEdpAnb5V0QLjV/tRyUW4CgSq NcFTZs2tdAv3K+E6B2GfjesI8+f7YpAbXPU9Ar4h7LyD5IJ0WfURhBxeBmCyZmhaS+DxiPEN0n+Mo 4TFbxvcGkCgMyvGOlfcN6A==; Received: from [87.69.77.57] (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 1q7dTM-0005kx-5H; Fri, 09 Jun 2023 10:52:23 -0400 Date: Fri, 09 Jun 2023 17:52:24 +0300 Message-Id: <83h6rg1ydz.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com, Stefan Monnier , Lars Ingebrigtsen In-Reply-To: (hugo@heagren.com) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: <83355iygw3.fsf@gnu.org> <83mt2hfrr4.fsf@gnu.org> <4b872ecc12e3995d5b7dfffa580e297d@heagren.com> <83zg5c3kbo.fsf@gnu.org> <83ilbw22zh.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 09 Jun 2023 15:28:36 +0100 > From: hugo@heagren.com > > On 2023-06-09 14:13, Eli Zaretskii wrote: > > You can accomplish that by padding, even without right-alignment, I > > think. > > Yes you can. I just prefer how right-alignment looks. You can even think > of right-alignment as ane extreme case of padding, if > > >> Overall, I can see that this isn't a feature you like, and probably > >> not > >> one you would use either, but it's similar enough (in function and in > >> problems) to other stuff already in Emacs > > > > Sadly. > > Since you don't agree with the general implementation or function of > this patch, I don't think I'm going to be able to do anything to make it > more acceptable for you. > > I've fixed all the technical issues which have been pointed out (except > the thing about calling `string-pixel-width', that's way beyond my > skills atm). Clearly some people (whoever wrote and now uses > `tab-bar-format-align-right') like features like this, so I think this > is worth merging, in basically the state its in now. If you don't > though, I'm happy to publish it as a separate package. What do you > think? Let's hear from others. Stefan, Lars, any thoughts? Does anyone else have any comments about this proposed feature? In any case, before we accept this, it must be documented and called out in NEWS. Also, the defcustom should have a :version tag. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 09 12:03:13 2023 Received: (at 62606) by debbugs.gnu.org; 9 Jun 2023 16:03:14 +0000 Received: from localhost ([127.0.0.1]:60195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7ea1-0000Us-Gq for submit@debbugs.gnu.org; Fri, 09 Jun 2023 12:03:13 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7eZz-0000Ua-VF for 62606@debbugs.gnu.org; Fri, 09 Jun 2023 12:03:12 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CA9A2442908; Fri, 9 Jun 2023 12:03:05 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 02931442903; Fri, 9 Jun 2023 12:03:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1686326584; bh=LoxBt43Vay/CCFgoxIUFZ3N9YqxKkAXfPXF4C6FiFIo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TuIR7ca6ViMQXgU3s9TbJDI0G5FXcftvZwdRa8ZsYpL0+qvjLche+4qUr4n666HYs 8YDEuvkU9YLe9LxalkNOVJL+uYWCwv6KQ+3fLcoV/+YisNFVtknc1FuCQLaqVoNcvs 5Um9vXZIr8YKFVnDeIPXd/sLCqu/r2/TxiAWSj3GSMVgw72UPvwME3sYazuhiHfiR9 szEI9WDmU3rfespqrDa4zp2yJ/PHKDtXMJHZ0CZ1b/KVlBskT+dKL3E6NtNplZe4wR xfTDbIXX0YgmuYMg3pzZPaH07ARjdId6SI2jC+zWbg6Vpv/3uPgT/KM9mjo31rkXcn PLCrlMRkNw8qA== Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AB9421205D9; Fri, 9 Jun 2023 12:03:03 -0400 (EDT) From: Stefan Monnier To: hugo@heagren.com Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: (hugo@heagren.com's message of "Sat, 01 Apr 2023 23:27:31 +0100") Message-ID: References: Date: Fri, 09 Jun 2023 12:03:02 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.011 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Let's hear from others. Stefan, Lars, any thoughts? Does anyone else > have any comments about this proposed feature? FWIW, my mode-lines always tend to overflow to the right, so I wouldn't be able to use that functionality, but I have no doubt that it would be welcome by several users, based on some of the mode-lines I've seen elsewhere. Also, the code is fairly simple and self-contained, so I don't see a good reason not to include that. Some comments about the code below: > +(defcustom mode-line-right-align-edge 'window > + "Where function `mode-line-format-right-align' should align to. > + > +Must be set to a symbol. Acceptable values are: > +- window: align to extreme right of window, regardless of margins > + or fringes > +- right-fringe: align to right-fringe > +- right-margin: align to right-margin > +- right: synonym for right-margin (supported because this is how the > + display property understands this, see info node `(elisp)Specified > + Space'.)" I think symbols like `right-fringe` should be enclosed in `...' in docstrings. Also, I see no reason to encourage the use of an alias, so I'd drop either `right-margin` or `right` from the doc (especially since it doesn't really come for free in the code). As a user I'd wonder if "align to right-fringe" means to align to the beginning (i.e. left side) or end (i.e. right side) of the right fringe. [ And now I wonder: can Emacs have R2L modelines? If so, what should happen in those? ] > +(defun mode-line-format-right-align () > + "Right-align all following mode-line constructs. > + > +When the symbol `mode-line-format-right-align' appears in > +`mode-line-format', return a string of one space, with a display > +property to make it appear long enough to align anything after > +that symbol to the right of the rendered mode line. Exactly how > +far to the right is controlled by `mode-line-right-align-edge'. > + > +It is important that the symbol `mode-line-format-right-align' be > +included in `mode-line-format' (and not another similar construct > +such as `(:eval (mode-line-format-right-align)'). This is because > +the symbol `mode-line-format-right-align' is processed by > +`format-mode-line' as a variable." AFAICT, this function is internal to the implementation of the `mode-line-format-right-align` mode-line spec. So maybe it should use "--" in its name. > + (let* ((rest (cdr (memq 'mode-line-format-right-align > + mode-line-format))) This is the ugly part of the implementation: the `mode-line-format-right-align` has to "find itself". I wonder if/how we could get rid of this wrinkle. Maybe instead of a `mode-line-format` of the form: (..LEFT.. mode-line-format-right-align ..RIGHT..) an alternative is to use (..LEFT.. (:eval (mode-line-format-right-align ..RIGHT..))) I wonder if it would work as well (I'm worried that it means that `..RIGHT..` is not processed directly by the C code by goes through the `format-mode-line` ELisp function to turn it into an ELisp string first and that could affect the result). It would have the advantage that it doesn't process `..RIGHT..` twice, and it should also be usable in `header-line-format` and friends. It's not great tho :-( Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 09 12:17:25 2023 Received: (at 62606) by debbugs.gnu.org; 9 Jun 2023 16:17:25 +0000 Received: from localhost ([127.0.0.1]:60214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7enl-0000qU-DX for submit@debbugs.gnu.org; Fri, 09 Jun 2023 12:17:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7enj-0000qH-C5 for 62606@debbugs.gnu.org; Fri, 09 Jun 2023 12:17:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7enc-0001MY-Kl; Fri, 09 Jun 2023 12:17:17 -0400 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=qmVvdsMCmTfhav3IYVDrzbiTVhR707nDaX24fF5SwHU=; b=msadvWROWRZV Ud+S/5EQZn1+k1VFyBLeMxozm0ib/GYghzPEEZ/Gt7PyNBWHyPlSNK9itL3ECgaSayLsnanAR+OOd /dC5STHLlJxbFtpC5nx8PoCMMo6/XIW+KNL1Elhe2XjajzveDDiPHDL57qCTnxHZN3NXfw/NvGocO mIYnmFbxTI6kQVHOYkd9X7QQQJ41LXsQFd8DrAtMs4MEk+HLZLjNUU9c7MSnzh0EYFm4NlihcqO03 YYma33Vj378RvrvS/6sTGQMLVdEOyr4rA8+riIRiLqYxxPmIifJgZZS+BIdzE+zJb8a/bzycBEqvJ sRKYI0sspyxqCYsO44keRw==; Received: from [87.69.77.57] (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 1q7enc-0002KO-0t; Fri, 09 Jun 2023 12:17:16 -0400 Date: Fri, 09 Jun 2023 19:17:25 +0300 Message-Id: <83edmk1uga.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: hugo@heagren.com, 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 62606@debbugs.gnu.org > Date: Fri, 09 Jun 2023 12:03:02 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > [ And now I wonder: can Emacs have R2L modelines? If so, what should > happen in those? ] We don't support that. From display_mode_line: /* FIXME: This should be controlled by a user option. But supporting such an option is not trivial, since the mode line is made up of many separate strings. */ it.paragraph_embedding = L2R; and a more complete rationale in redisplay_tool_bar: /* FIXME: This should be controlled by a user option. But it doesn't make sense to have an R2L tool bar if the menu bar cannot be drawn also R2L, and making the menu bar R2L is tricky due toolkit-specific code that implements it. If an R2L tool bar is ever supported, display_tool_bar_line should also be augmented to call unproduce_glyphs like display_line and display_string do. */ Bottom line: Emacs doesn't support making the UI right-to-left. IMNSHO in IME, supporting that would be a lot of work for very little benefit. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 09 12:52:33 2023 Received: (at 62606) by debbugs.gnu.org; 9 Jun 2023 16:52:33 +0000 Received: from localhost ([127.0.0.1]:60256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7fLk-0001nW-Kn for submit@debbugs.gnu.org; Fri, 09 Jun 2023 12:52:32 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:48848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7fLj-0001nI-A1 for 62606@debbugs.gnu.org; Fri, 09 Jun 2023 12:52:31 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B858144291B; Fri, 9 Jun 2023 12:52:25 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5835C4402C0; Fri, 9 Jun 2023 12:52:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1686329544; bh=bZR3L1Z/biPXI3qak0iDRazo/V+jZ0hBO4NrWrJ/u4c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Ve+gmzjn1/9XASOZqe6op5YTncORS3heeSC4Zt7SrKUz7dC/atKrzzCZFirigsJd0 MBpJ6uenGJvKkis9fGOlSI8z8Co2L6tngdFcL+W5NpKtB2tjMgbLGG99SoDhqpUXUR xhAiHSa39tSA8ktLyrFKlk95fhJMBc72/LtJ4USIz/yvOIP+ECB+jF4Dpyhoxia4nP pUKNey6lBCgOvJia8T/AWRYACMhgppArjbJcRFXHZt1KjrAq0Z1QBf0Oq4rXSYNwcd VREH+gPdMenWxpT6y01OmhTh3cuTvDgqIWHq7KeOK2Phx733yInDWVrxAAaPHOt4tk u8mDx9/Rj7IdA== Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2FFF1120187; Fri, 9 Jun 2023 12:52:24 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: R2L modelines (was: bug#62606: [PATCH] function to align mode-line elements to right) In-Reply-To: <83edmk1uga.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Jun 2023 19:17:25 +0300") Message-ID: References: <83edmk1uga.fsf@gnu.org> Date: Fri, 09 Jun 2023 12:52:23 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.011 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: hugo@heagren.com, 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> [ And now I wonder: can Emacs have R2L modelines? If so, what should >> happen in those? ] [...] > Bottom line: Emacs doesn't support making the UI right-to-left. > IMNSHO in IME, supporting that would be a lot of work for very little > benefit. Indeed, it seems to be of any real use, we'd first need to be able to translate most of the elements (like mode names, menu titles, ...). [ Sorry for this offtopic drift in the thread. I'll stop here. ] Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 19 15:07:10 2023 Received: (at 62606) by debbugs.gnu.org; 19 Jun 2023 19:07:10 +0000 Received: from localhost ([127.0.0.1]:57305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBKDV-0000Z0-OU for submit@debbugs.gnu.org; Mon, 19 Jun 2023 15:07:10 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]:48586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBKDT-0000YU-9s for 62606@debbugs.gnu.org; Mon, 19 Jun 2023 15:07:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To: From:Date:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Tjoss81kQeTyHaNOCJ9r5Kme9gFNkrRqAoqrPNPMUC8=; b=cA/DBJXqv3A5GlsmmCJgw0HmuH N1IBStptrLWhY5yG10EO/C5I+Q7InV621pfxg/sxK9OW8FecIbiaPdm2quNF14DcP00U2JFXpWwOb tjF/HwdIoj9gM2QMRIZzxu97288pJoRFNaUpnXXZe7LZLznZj769oOscWY+oBCBV1HVtoQgTWZgT5 IcB4RX6yoCnoaj9ZI6RvvUngnNAj/h725BUNw+ulrCNc44nXdlXKe+eKLUaKAjrMEgIkO+avcjusZ 23iSzuHSWT9WsEee5ddgDzetLNMzFb8lsJSWUnhQhdimcv1JIeEAuJwwJC+hVQemYv/vO610Fd1iN W2coE8Ew==; Received: from [::1] (port=43444 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.96) (envelope-from ) id 1qBKDL-00FBxr-2U; Mon, 19 Jun 2023 20:06:59 +0100 MIME-Version: 1.0 Date: Mon, 19 Jun 2023 20:06:58 +0100 From: hugo@heagren.com To: Stefan Monnier Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: References: User-Agent: Roundcube Webmail/1.6.0 Message-ID: X-Sender: hugo@heagren.com Content-Type: multipart/mixed; boundary="=_ab35e48d8ee9137f38f97ecb8611e218" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62606 Cc: 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=_ab35e48d8ee9137f38f97ecb8611e218 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 2023-06-09 17:03, Stefan Monnier wrote: > Also, the code is fairly simple and self-contained, so I don't see > a good reason not to include that. Thanks :) > I think symbols like `right-fringe` should be enclosed in `...' > in docstrings. Fixed in new patch, attached. > Also, I see no reason to encourage the use of an alias, > so I'd drop either `right-margin` or `right` from the doc (especially > since it doesn't really come for free in the code). Fixed. Dropped `right', as it was the less descriptive version. > As a user I'd wonder if "align to right-fringe" means to align to > the beginning (i.e. left side) or end (i.e. right side) of the > right fringe. Documented (and included a link to relevant info node). > AFAICT, this function is internal to the implementation of the > `mode-line-format-right-align` mode-line spec. So maybe it should use > "--" in its name. You're right -- Done. > This is the ugly part of the implementation Yes, I agree :( > an alternative is to use > > (..LEFT.. (:eval (mode-line-format-right-align ..RIGHT..))) I share your technical worries about this. I worry too that this might end up being more confusing for users, because it invites such constructions as: (..LEFT.. (:eval (mode-line-format-right-align ..RIGHT..)) ..WHAT..) Where the behaviour of ..WHAT.. is at best to be completely hidden, and at worst undefined. If we use a single symbol, this can't happen. I also think that, as a user, it's good to have consistent interfaces for this sort of thing, and my proposed function is intended to work just like `tab-bar-format-align-right', which is included as a symbol, not a more complex construction. > should also be usable in `header-line-format` and friends. This would good though. Hugo --=_ab35e48d8ee9137f38f97ecb8611e218 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Support-right-align-in-mode-line.patch Content-Disposition: attachment; filename=0001-Support-right-align-in-mode-line.patch; size=4483 RnJvbSBiOWZiNjM5OWYzOGYyNTBlOTYyOWU4MzUwMTA4ZWE5MzRkNGNmZDk3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBIdWdvIEhlYWdyZW4gPGh1Z29AaGVhZ3Jlbi5jb20+CkRhdGU6 IFNhdCwgMSBBcHIgMjAyMyAyMjoyNzoyNSArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIFN1cHBvcnQg cmlnaHQtYWxpZ24gaW4gbW9kZS1saW5lCgoqIGxpc3AvYmluZGluZ3MuZWwgKG1vZGUtbGluZS1y aWdodC1hbGlnbi1lZGdlKTogIE5ldyBjdXN0b20gdmFyaWFibGUuCkNvbnRyb2xzIHdoZXJlIGBt b2RlLWxpbmUtZm9ybWF0LXJpZ2h0LWFsaWduJyBzaG91bGQgYWxpZ24gdG8uCihtb2RlLWxpbmUt Zm9ybWF0LXJpZ2h0LWFsaWduKTogIE5ldyBmdW5jdGlvbi4gIElmIHRoZSBzeW1ib2wKYG1vZGUt bGluZS1mb3JtYXQtcmlnaHQtYWxpZ24nIGFwcGVhcnMgaW4gYG1vZGUtbGluZS1mb3JtYXQnLCB0 aGVuCnJldHVybiByZXR1cm4gYSBwYWRkaW5nIHN0cmluZyB3aGljaCBhbGlnbnMgZXZlcnl0aGlu ZyBhZnRlciB0aGF0CnN5bWJvbCB0byB0aGUgcmlnaHQuICBQYWRkaW5nIHdpZHRoIGlzIGFsdGVy ZWQgd2l0aCB0aGUgZGlzcGxheQpwcm9wZXJ0eSBhbmQgZGVwZW5kcyBvb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HRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAod2luZG93LXNjcm9sbC1iYXItd2lkdGgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICh3aW5kb3ctcmlnaHQtZGl2aWRlci13aWR0aCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogKG9yIChjZHIgKHdpbmRv dy1tYXJnaW5zKSkgMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKGZyYW1lLWNoYXItd2lkdGgpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA7OyBNYW51YWxseSBhY2NvdW50IGZvciB2YWx1ZSBvZgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBgbW9kZS1saW5lLXJpZ2h0LWFsaWduLWVkZ2Un IGV2ZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgd2hlbiBk aXNwbGF5IGlzIG5vbi1ncmFwaGljYWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKHBjYXNlIG1vZGUtbGluZS1yaWdodC1hbGlnbi1lZGdlCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCdyaWdodC1tYXJnaW4KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG9yIChjZHIgKHdpbmRvdy1tYXJnaW5z KSkgMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCdyaWdo dC1mcmluZ2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsg d2hhdCBoZXJlPworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo b3IgKGNhZHIgKHdpbmRvdy1mcmluZ2VzKSkgMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKF8gMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHJlc3Qtd2lkdGgpKSkpKSkpCisKKyhkZWZ2YXIgbW9kZS1saW5lLWZvcm1hdC1y aWdodC1hbGlnbiAnKDpldmFsIChtb2RlLS1saW5lLWZvcm1hdC1yaWdodC1hbGlnbikpCisgICJN b2RlIGxpbmUgY29uc3RydWN0IHRvIHJpZ2h0IGFsaWduIGFsbCBmb2xsb3dpbmcgY29uc3RydWN0 cy4iKQorOzs7IyMjYXV0b2xvYWQKKyhwdXQgJ21vZGUtbGluZS1mb3JtYXQtcmlnaHQtYWxpZ24g J3Jpc2t5LWxvY2FsLXZhcmlhYmxlIHQpCisKIChkZWZ1biBiaW5kaW5ncy0tZGVmaW5lLWtleSAo bWFwIGtleSBpdGVtKQogICAiRGVmaW5lIEtFWSBpbiBrZXltYXAgTUFQIGFjY29yZGluZyB0byBJ VEVNIGZyb20gYSBtZW51LgogVGhpcyBpcyBsaWtlIGBkZWZpbmUta2V5JywgYnV0IGl0IHRha2Vz IHRoZSBkZWZpbml0aW9uIGZyb20gdGhlCi0tIAoyLjIwLjEKCg== --=_ab35e48d8ee9137f38f97ecb8611e218-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 24 08:05:22 2023 Received: (at 62606) by debbugs.gnu.org; 24 Jun 2023 12:05:22 +0000 Received: from localhost ([127.0.0.1]:40022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qD213-00060k-PN for submit@debbugs.gnu.org; Sat, 24 Jun 2023 08:05:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qD211-00060X-42 for 62606@debbugs.gnu.org; Sat, 24 Jun 2023 08:05:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qD20u-0006UD-L5; Sat, 24 Jun 2023 08:05:12 -0400 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=mvzq6c+J137x7DyuDU5uc9rPIpuUE45HveyjUperpQw=; b=PXRHA+Q5etlk BOX02hSksi/i20LR2hU772VcxrpPHb9V9uIpxMikFXV3n2gwKJraI3rWT9QpU86GVshK+HVJg2MQu Ky4TTDRQRxVi1EMxfsffUdhp21WiJO380X0BypGXmZQMnys/i+VNO3S4MWym1f2QUAhuFPateArxu Q2Phw68SshQbqRX/FKsEHm4t21V7sfrpSzsLs6LNpdq1fRaSH5heDlXLyZjhK5dBAy1vvfxugk0ij 3cxrEEEfOukzUXBraVqc5yWgSMvE8tviOVKOCzNjQ39w0C/5gDJhxTtImbey+juJYDFXZ2Jtj8WbO yxEWd/K1UDbko8ozNv5WsQ==; Received: from [87.69.77.57] (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 1qD20t-00050j-Un; Sat, 24 Jun 2023 08:05:12 -0400 Date: Sat, 24 Jun 2023 15:05:27 +0300 Message-Id: <83leg9ysjc.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com In-Reply-To: (hugo@heagren.com) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: monnier@iro.umontreal.ca, 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 62606@debbugs.gnu.org > Date: Mon, 19 Jun 2023 20:06:58 +0100 > From: hugo@heagren.com > > On 2023-06-09 17:03, Stefan Monnier wrote: > > Also, the code is fairly simple and self-contained, so I don't see > > a good reason not to include that. > > Thanks :) > > > I think symbols like `right-fringe` should be enclosed in `...' > > in docstrings. > > Fixed in new patch, attached. > > > Also, I see no reason to encourage the use of an alias, > > so I'd drop either `right-margin` or `right` from the doc (especially > > since it doesn't really come for free in the code). > > Fixed. Dropped `right', as it was the less descriptive version. > > > As a user I'd wonder if "align to right-fringe" means to align to > > the beginning (i.e. left side) or end (i.e. right side) of the > > right fringe. > > Documented (and included a link to relevant info node). > > > AFAICT, this function is internal to the implementation of the > > `mode-line-format-right-align` mode-line spec. So maybe it should use > > "--" in its name. > > You're right -- Done. > > > This is the ugly part of the implementation > > Yes, I agree :( > > > an alternative is to use > > > > (..LEFT.. (:eval (mode-line-format-right-align ..RIGHT..))) > > I share your technical worries about this. I worry too that this might > end > up being more confusing for users, because it invites such constructions > as: > > (..LEFT.. (:eval (mode-line-format-right-align ..RIGHT..)) ..WHAT..) > > Where the behaviour of ..WHAT.. is at best to be completely hidden, and > at worst undefined. If we use a single symbol, this can't happen. > > I also think that, as a user, it's good to have consistent interfaces > for this sort of thing, and my proposed function is intended to work > just like `tab-bar-format-align-right', which is included as a symbol, > not a more complex construction. > > > should also be usable in `header-line-format` and friends. > > This would good though. Thanks. This will need suitable additions to NEWS and the manual. Also, we will need you to sign the copyright assignment paperwork, as the size of the changes exceeds what we can accept without an assignment. Would you like to start your assignment paperwork rolling at this time? From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 06:06:58 2023 Received: (at 62606) by debbugs.gnu.org; 26 Jun 2023 10:06:58 +0000 Received: from localhost ([127.0.0.1]:44577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDj7a-00061v-Bs for submit@debbugs.gnu.org; Mon, 26 Jun 2023 06:06:58 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]:46356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDj7X-00061e-HB for 62606@debbugs.gnu.org; Mon, 26 Jun 2023 06:06:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=0SrFEruanXYAQbjEaBtR+RGw1tBGYjqAJ0G4zBehH2k=; b=a3ftiPCc8komRwSNUvdXvvEUIR UtasZ6xHLtk+KTIS5IPuSMGRDuPYjalSh3+ebK4Ro94zn4JgELPdyq2Y6XM8uSOUaHdSV21z2E3Hj 9Bpg0Z0rTX1h/wranTkc7feUF3cnnSmAT7vq0BnLFxanYudtv0n4joZGhUW8NpxW/iicXVj5Ua9SS uuqkRpufCBv4Bo8JquSlpGHs4yy50bVxV99SlBTLY7VkMRuSpv2YK22X2Tgz0kzEJroE+drpA48mx wCMPw2+YGH9yMNGNVKXsp2ofA4P7GEaCpY9c5uHJKODEwIJoLMoQkGwIkZSYI87XyRMmsBSnJD5Cm ZouTwefg==; Received: from [::1] (port=56332 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.96) (envelope-from ) id 1qDj7R-00Bwwh-2D; Mon, 26 Jun 2023 11:06:49 +0100 MIME-Version: 1.0 Date: Mon, 26 Jun 2023 11:06:48 +0100 From: hugo@heagren.com To: Eli Zaretskii Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: <83leg9ysjc.fsf@gnu.org> References: <83leg9ysjc.fsf@gnu.org> User-Agent: Roundcube Webmail/1.6.0 Message-ID: X-Sender: hugo@heagren.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62606 Cc: monnier@iro.umontreal.ca, 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > This will need suitable additions to NEWS and the manual. Sure, I'll write a new patch as soon as I have time. Hopefully this week. > Also, we will need you to sign the copyright assignment paperwork, as > the size of the changes exceeds what we can accept without an > assignment. Would you like to start your assignment paperwork rolling > at this time? I'v already assinged copyright -- I've contributed to Emacs before. Hugo From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 26 07:55:51 2023 Received: (at 62606) by debbugs.gnu.org; 26 Jun 2023 11:55:51 +0000 Received: from localhost ([127.0.0.1]:44691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDkox-00039N-9W for submit@debbugs.gnu.org; Mon, 26 Jun 2023 07:55:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDkou-000399-SN for 62606@debbugs.gnu.org; Mon, 26 Jun 2023 07:55:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDkon-00033p-9T; Mon, 26 Jun 2023 07:55:42 -0400 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=xRBbD1QeEqpSloP0NPwSS/7UYMF8z84Sxm41a2ZrJf8=; b=k1rI0JEL+iLY /B4dbEKD20z+THThYYD3cxNqahSmAXe1PDQKnOYrpa0CvnWzVowWsigHne6N0pV8CQ5EUUyzwJPjR CsjxDKoLFJ8MpE8VSp4aVmnkci65+c505eUuMDplBwuDVq0Gzlm7HaS0L9Z9KFtY5laMXSySkkoF5 7dD0X7qp/i9JdgGKKzNlYZ9CdzuzzeNeGuQ52qOVTJEBq1OCpyyOJp1ka5Yd8opzdF57XfIEI3xAE iVbNb7mt5qw3RQ3Vi/fUIBOcugPGTq3cfBqfvEP+mrlf0O1YhjfHi5vPXaSDw2E8Qor4fUT1S0gf1 w9FjZcayKFVzXV21xQc5MA==; Received: from [87.69.77.57] (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 1qDkof-0003Jp-5D; Mon, 26 Jun 2023 07:55:38 -0400 Date: Mon, 26 Jun 2023 14:55:54 +0300 Message-Id: <83zg4mwi7p.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com In-Reply-To: (hugo@heagren.com) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: <83leg9ysjc.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: monnier@iro.umontreal.ca, 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 26 Jun 2023 11:06:48 +0100 > From: hugo@heagren.com > Cc: monnier@iro.umontreal.ca, 62606@debbugs.gnu.org > > > This will need suitable additions to NEWS and the manual. > > Sure, I'll write a new patch as soon as I have time. Hopefully this > week. Thanks. > > Also, we will need you to sign the copyright assignment paperwork, as > > the size of the changes exceeds what we can accept without an > > assignment. Would you like to start your assignment paperwork rolling > > at this time? > > I'v already assinged copyright -- I've contributed to Emacs before. Yes, I see it now, sorry. (I didn't find it before because your name appears in the list of assignment with a typo. Should be fixed soon.) From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 02 08:43:32 2023 Received: (at 62606) by debbugs.gnu.org; 2 Jul 2023 12:43:32 +0000 Received: from localhost ([127.0.0.1]:59494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFwQN-0002FW-JE for submit@debbugs.gnu.org; Sun, 02 Jul 2023 08:43:32 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]:34528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFwQL-0002FI-6i for 62606@debbugs.gnu.org; Sun, 02 Jul 2023 08:43:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To: From:Date:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=5QA1U6gSsnyjfDwb5tG4V1m+nx+U/qhJodTfYY7dU8E=; b=nTCgiOVSx/lwLvSao99/10Khne CmEOZljVlQncib62jiCfD7Ghcv+LW9ldlSctcQYHBIGhZUx5W1ngNg6XmVXWljQAf4H5J4GTX8L8G WquBmQWZoGT3sfSZ9Za4uMIx3qpn/ok/KRQpDS8+RVSk/22jHwGzS7sKgCnImYoWMtD0E2LKHRlXY 2wUHgE8SBlEdkLPkUzpocBv8xW6zASQleRRNaqwu+6kGLObk1k6nrUH3fjiCDbRbE0ZZbNdv3h97j /Fpw0pyNzlXVTP3SY9x4x+MMckxomoDLaUYUeKrDsIKX3XteItacupMo1SqzpnL/wIPDeftNYFtQ6 bKvSD2dw==; Received: from [::1] (port=50132 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.96) (envelope-from ) id 1qFwQE-007QiP-1X; Sun, 02 Jul 2023 13:43:22 +0100 MIME-Version: 1.0 Date: Sun, 02 Jul 2023 13:43:21 +0100 From: hugo@heagren.com To: Eli Zaretskii Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: <83zg4mwi7p.fsf@gnu.org> References: <83leg9ysjc.fsf@gnu.org> <83zg4mwi7p.fsf@gnu.org> User-Agent: Roundcube Webmail/1.6.0 Message-ID: <15c04eac1a68f65a43d97553dc268d4d@heagren.com> X-Sender: hugo@heagren.com Content-Type: multipart/mixed; boundary="=_c9014e7849fa8a18adbc0167921b02cc" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62606 Cc: monnier@iro.umontreal.ca, 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=_c9014e7849fa8a18adbc0167921b02cc Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed > This will need suitable additions to NEWS New patch attached with addition to NEWS (and a version tag for the defcustom, which I forgot last time). I haven't marked the news item with +++ or ---, wasn't sure whether I've done everything I need to yet. > and the manual I've added documentation to the 'Mode Line Variables' section of the Elisp manual. This seemed to be where similar things were documented. Updated my commit message to reflect this. >> I'v already assinged copyright -- I've contributed to Emacs before. > Yes, I see it now, sorry. (I didn't find it before because your name > appears in the list of assignment with a typo. Should be fixed soon.) Do I need to update my AUTHORs entry with this new change? Hope that's all good. Hugo --=_c9014e7849fa8a18adbc0167921b02cc Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Support-right-align-in-mode-line.patch Content-Disposition: attachment; filename=0001-Support-right-align-in-mode-line.patch; size=5896 RnJvbSBjZTVmOGI4NmE1NmViNTFmNGMzMjBhODZkZTBjMDQ0NGM5ZjA1MmNlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBIdWdvIEhlYWdyZW4gPGh1Z29AaGVhZ3Jlbi5jb20+CkRhdGU6 IFNhdCwgMSBBcHIgMjAyMyAyMjoyNzoyNSArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIFN1cHBvcnQg cmlnaHQtYWxpZ24gaW4gbW9kZS1saW5lCgoqIGxpc3AvYmluZGluZ3MuZWwgKG1vZGUtbGluZS1y aWdodC1hbGlnbi1lZGdlKTogIE5ldyBjdXN0b20gdmFyaWFibGUuCkNvbnRyb2xzIHdoZXJlIGBt b2RlLWxpbmUtZm9ybWF0LXJpZ2h0LWFsaWduJyBzaG91bGQgYWxpZ24gdG8uCihtb2RlLWxpbmUt Zm9ybWF0LXJpZ2h0LWFsaWduKTogIE5ldyBmdW5jdGlvbi4gIElmIHRoZSBzeW1ib2wKYG1vZGUt bGluZS1mb3JtYXQtcmlnaHQtYWxpZ24nIG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gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAod2luZG93LXNjcm9sbC1iYXItd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICh3aW5kb3ctcmlnaHQtZGl2aWRlci13aWR0aCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogKG9yIChjZHIgKHdpbmRvdy1tYXJnaW5zKSkg MSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZyYW1lLWNo YXItd2lkdGgpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBN YW51YWxseSBhY2NvdW50IGZvciB2YWx1ZSBvZgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA7OyBgbW9kZS1saW5lLXJpZ2h0LWFsaWduLWVkZ2UnIGV2ZW4KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgd2hlbiBkaXNwbGF5IGlzIG5v bi1ncmFwaGljYWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBj YXNlIG1vZGUtbGluZS1yaWdodC1hbGlnbi1lZGdlCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKCdyaWdodC1tYXJnaW4KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKG9yIChjZHIgKHdpbmRvdy1tYXJnaW5zKSkgMCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCdyaWdodC1mcmluZ2UKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgd2hhdCBoZXJlPwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgKGNhZHIgKHdp bmRvdy1mcmluZ2VzKSkgMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKF8gMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJl c3Qtd2lkdGgpKSkpKSkpCisKKyhkZWZ2YXIgbW9kZS1saW5lLWZvcm1hdC1yaWdodC1hbGlnbiAn KDpldmFsIChtb2RlLS1saW5lLWZvcm1hdC1yaWdodC1hbGlnbikpCisgICJNb2RlIGxpbmUgY29u c3RydWN0IHRvIHJpZ2h0IGFsaWduIGFsbCBmb2xsb3dpbmcgY29uc3RydWN0cy4iKQorOzs7IyMj YXV0b2xvYWQKKyhwdXQgJ21vZGUtbGluZS1mb3JtYXQtcmlnaHQtYWxpZ24gJ3Jpc2t5LWxvY2Fs LXZhcmlhYmxlIHQpCisKIChkZWZ1biBiaW5kaW5ncy0tZGVmaW5lLWtleSAobWFwIGtleSBpdGVt KQogICAiRGVmaW5lIEtFWSBpbiBrZXltYXAgTUFQIGFjY29yZGluZyB0byBJVEVNIGZyb20gYSBt ZW51LgogVGhpcyBpcyBsaWtlIGBkZWZpbmUta2V5JywgYnV0IGl0IHRha2VzIHRoZSBkZWZpbml0 aW9uIGZyb20gdGhlCi0tIAoyLjIwLjEKCg== --=_c9014e7849fa8a18adbc0167921b02cc-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 06 03:35:40 2023 Received: (at 62606-done) by debbugs.gnu.org; 6 Jul 2023 07:35:40 +0000 Received: from localhost ([127.0.0.1]:39471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHJWe-0004Py-Dh for submit@debbugs.gnu.org; Thu, 06 Jul 2023 03:35:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHJWc-0004Pj-9Q for 62606-done@debbugs.gnu.org; Thu, 06 Jul 2023 03:35:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHJWW-0002qP-AD; Thu, 06 Jul 2023 03:35:32 -0400 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=n37fNBJ1q5K+aN4tUpXCR4InMQeae6UOJh3SABxBfQ8=; b=c5yrdrVDgeR0 MGyb2N7hHvN8ZaCkjqzd38ZGvs2K/ZH8LtsYnq9+N633CsqWyJxOEtu7Nw7ylXjwLYO1OoBmiFSiq C2yYHCGXU7ccB057fOvkkWqiqLZuv856Yr+o4gzzl9TeKOUkhGhnNWGCzIJ/jK2Go7b3VK4tja9kv JH040O7Wuo4cwEpFMFgSjhULe58YWKIQKQznoIG9eZZcisMwgTf2Ji1ha6yUBTKCzTfhKV3zYQ7O/ 1fr3FUUQcXEpQzZfqqiyBM5BLvMYSpbvREUJL/RhvWeYYO4UU1doih01fnVbSCVZFFr027oDIKpVk 37cWBlxEXp2cusWuFax5/w==; Received: from [87.69.77.57] (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 1qHJWK-0005WG-Jk; Thu, 06 Jul 2023 03:35:23 -0400 Date: Thu, 06 Jul 2023 10:35:20 +0300 Message-Id: <83jzvdijbb.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com In-Reply-To: <15c04eac1a68f65a43d97553dc268d4d@heagren.com> (hugo@heagren.com) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: <83leg9ysjc.fsf@gnu.org> <83zg4mwi7p.fsf@gnu.org> <15c04eac1a68f65a43d97553dc268d4d@heagren.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606-done Cc: 62606-done@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 02 Jul 2023 13:43:21 +0100 > From: hugo@heagren.com > Cc: monnier@iro.umontreal.ca, 62606@debbugs.gnu.org > > > This will need suitable additions to NEWS > > New patch attached with addition to NEWS (and a version tag for the > defcustom, which I forgot last time). I haven't marked the news item > with +++ or ---, wasn't sure whether I've done everything I need to yet. > > > and the manual > > I've added documentation to the 'Mode Line Variables' section of the > Elisp manual. This seemed to be where similar things were documented. > Updated my commit message to reflect this. > > >> I'v already assinged copyright -- I've contributed to Emacs before. > > Yes, I see it now, sorry. (I didn't find it before because your name > > appears in the list of assignment with a typo. Should be fixed soon.) > > Do I need to update my AUTHORs entry with this new change? > > Hope that's all good. Thanks, installed on the master branch, and closing the bug. In the future, please mention the bug number in the log message, when that number becomes known to you (basically, if you post an updated patch, the bug number should already be known). From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 14 12:44:49 2023 Received: (at 62606) by debbugs.gnu.org; 14 Jul 2023 16:44:49 +0000 Received: from localhost ([127.0.0.1]:43357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKLuS-0006t5-Sf for submit@debbugs.gnu.org; Fri, 14 Jul 2023 12:44:49 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:54143) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qKLuR-0006sd-DY for 62606@debbugs.gnu.org; Fri, 14 Jul 2023 12:44:47 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 66BE260006; Fri, 14 Jul 2023 16:44:39 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: (GNU bug Tracking System's message of "Thu, 06 Jul 2023 07:36:02 +0000") Organization: LINKOV.NET References: <83jzvdijbb.fsf@gnu.org> Date: Fri, 14 Jul 2023 19:37:10 +0300 Message-ID: <86pm4usb45.fsf_-_@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62606 Cc: hugo@heagren.com, 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Hope that's all good. > > Thanks, installed on the master branch, and closing the bug. I customized the mode-line to use variable-pitch fonts with (set-face-attribute 'mode-line nil :inherit '(variable-pitch)) that produces wrong right-alignment. This problem was already fixed in `tab-bar-format-align-right' by using `add-face-text-property'. This patch does the same for the mode-line: diff --git a/lisp/bindings.el b/lisp/bindings.el index f1a75b080be..047492e82d4 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -338,7 +338,10 @@ mode--line-format-right-align (let* ((rest (cdr (memq 'mode-line-format-right-align mode-line-format))) (rest-str (format-mode-line `("" ,@rest))) - (rest-width (string-pixel-width rest-str))) + (rest-width (progn + (add-face-text-property + 0 (length rest-str) 'mode-line t rest-str) + (string-pixel-width rest-str)))) (propertize " " 'display ;; The `right' spec doesn't work on TTY frames ;; when windows are split horizontally (bug#59620) From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 17 13:58:07 2023 Received: (at 62606) by debbugs.gnu.org; 17 Jul 2023 17:58:08 +0000 Received: from localhost ([127.0.0.1]:50890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLSU3-0004Ic-Nc for submit@debbugs.gnu.org; Mon, 17 Jul 2023 13:58:07 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:37705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLSU2-0004Hr-8z for 62606@debbugs.gnu.org; Mon, 17 Jul 2023 13:58:07 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id C1B1160003; Mon, 17 Jul 2023 17:57:59 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right In-Reply-To: <86pm4usb45.fsf_-_@mail.linkov.net> (Juri Linkov's message of "Fri, 14 Jul 2023 19:37:10 +0300") Organization: LINKOV.NET References: <83jzvdijbb.fsf@gnu.org> <86pm4usb45.fsf_-_@mail.linkov.net> Date: Mon, 17 Jul 2023 20:56:57 +0300 Message-ID: <86351m8lqu.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62606 Cc: hugo@heagren.com, 62606@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I customized the mode-line to use variable-pitch fonts with > > (set-face-attribute 'mode-line nil :inherit '(variable-pitch)) > > that produces wrong right-alignment. This problem was already fixed > in `tab-bar-format-align-right' by using `add-face-text-property'. > This patch does the same for the mode-line: Now pushed to master. From unknown Wed Aug 20 04:11:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 15 Aug 2023 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 21 05:12:39 2024 Received: (at control) by debbugs.gnu.org; 21 Jan 2024 10:12:39 +0000 Received: from localhost ([127.0.0.1]:36638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRUog-0004T4-IQ for submit@debbugs.gnu.org; Sun, 21 Jan 2024 05:12:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRUoe-0004Sj-7G; Sun, 21 Jan 2024 05:12:37 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRUoU-0006mc-S4; Sun, 21 Jan 2024 05:12:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=5b4cqYgIOzaHk6m0XMsz559o8+H5QlRXmSmTD6bMo7Y=; b=OuWZO16N1oQmXIfKECil XBS2rP4XiKk2fJVDrXNi8cQYPEW1UzLgn/IfnyTCNKnWi6/yed+NkPSwUouDgTIICMyR/uxRHxbCD 6HFptURt6bdw4BWEFwCIaKfTeRH1pyp+0pDSMf8EJv8yg6G3LG2kZdg4LXBUH/9B7YN8C7uWUmv5G CpxFw8d3BypUlMQh7bgx9haAn8/F+TbGOwQkSaKwFbZ1JYTiRfb1hsXGM/G/5Cu5bUaCEn7KlxAP/ 1GY2pOD/+XTaWnkQJqxqGzgz6RpZwH43f3QLdeZh8KfLEJ+jyOnTRqfvvYBHNe/6/kScRov3ajrRO fInOs9kZECxBoA==; Date: Sun, 21 Jan 2024 12:12:09 +0200 Message-Id: <835xznro5i.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: <87edebjcku.fsf@gmail.com> (message from =?utf-8?B?Sm/Do28g?= =?utf-8?B?VMOhdm9yYQ==?= on Sun, 21 Jan 2024 08:49:21 +0000) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: <83jzvdijbb.fsf@gnu.org> <86pm4usb45.fsf_-_@mail.linkov.net> <86351m8lqu.fsf@mail.linkov.net> <83fryrs1l8.fsf@gnu.org> <87edebjcku.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control Cc: hugo@heagren.com, 62606@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) unarchive 62606 thanks > From: João Távora > Cc: juri@linkov.net, hugo@heagren.com, 62606@debbugs.gnu.org > Date: Sun, 21 Jan 2024 08:49:21 +0000 > > Eli Zaretskii writes: > > > FWIW, I don't want to complicate xdisp.c on behalf of this obscure > > option. If it can be fixed in Lisp, I won't object, but otherwise I'm > > inclined to document the above as the limitation of the option, and > > move on. > > Won't be fixed in Lisp without redesigning the API. Then it probably will stay as a limitation. > Option is new but it is not "obscure". Fancy side-aligning mode-lines > are are all the rage. I have to admit for pretty good reason, even I > use this kind of mode-line now. > > Anyway, here's a patch fixing it. It's 1 LOC in display_mode_element > and a new variable. mode-line-format-right-align is simplified and > possibly even slightly sped up. Thanks, but I don't want to expose the tail of the mode-line to Lisp, let alone do it on every iteration through mode-line-format. If this is the only reasonable way of lifting the restriction, it will remain to be a restriction of this optional behavior. Sorry. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 21 05:21:08 2024 Received: (at 62606) by debbugs.gnu.org; 21 Jan 2024 10:21:08 +0000 Received: from localhost ([127.0.0.1]:36665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRUwt-0007RP-S5 for submit@debbugs.gnu.org; Sun, 21 Jan 2024 05:21:08 -0500 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]:53324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRUwq-0007QU-K8 for 62606@debbugs.gnu.org; Sun, 21 Jan 2024 05:21:05 -0500 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-50e7abe4be4so2863143e87.2 for <62606@debbugs.gnu.org>; Sun, 21 Jan 2024 02:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705832455; x=1706437255; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o4UnSPP7noEST4vFrBX5v4QJln6yUMRZfCXhsSvvCGw=; b=U5ihtWA2LLzYUoh+eRsRxBa85rYc1G+P0LRbYPqyWCWfyHpaT7U520y/hbbQrdnPWM 1gB22CGJQHYmBrbNB73PSGyf9gd8YzUX9LXOeIJgqUnwrFQAxaWW/hPBV5f2xzVbuHjr iCvGNWFnnI2lwXZjN3ykd5ZjKpcDm9uYoA7qS0pL+GCLdC/3qJ/P11e7QsRB6VWzy3Gn 26EwHCHYtOTYwWXGH2l5ka8e4HzZPpTbb0HJODY8gaii+s7mLo2Qce1wJ5X33r4hoXyr SqFaOpybO8V0GXenhl3HwcBIYTtGDbDrudezhNAVDdjoRUqHPST1ZzZbuhRDOHOzXkgQ Ey4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705832455; x=1706437255; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o4UnSPP7noEST4vFrBX5v4QJln6yUMRZfCXhsSvvCGw=; b=L/FnL/+RwkRaFmdimqo8DaZpdM+GIeG8IhqTy0dNFyXM+uIF+seU+J3YoTaQhBOn0m ER271JXu9fu0nVllznWakPnX46IiC1vKmOER7Yb/fmm27awh4SXuBXTgB+qshK1x0bEV f2q64smQ/ZKERQaErxIlxt6l0Wy2a+tWRO5PxCw8zr+ZU++Iwo9wvfoyLNwXJ/wKr6Is qpRFINIloOi6xrBbitRmIDT3WZe9i8H2WpW4wYnm/N6Ti86iipkFZhq67TnnkILAk8eJ 9gGWKOn/ViogUOOdfAacOQjykSMg37RbeO5S6DP3FL1V7ZcHyNqB3olxbJwWuVMzWoaz ew8A== X-Gm-Message-State: AOJu0YzakDZFdGE8tRmElQyGp5GVJSFJ3Mh/0q7va6KgMRAX47y7McOZ ZQ/hkgUXEEGhno+tnK/wC3hNsAuwyh7/fGrKTbT1laR7QZaTJgBoBALySBGoFpcYcnlDSvhyn46 HGH/NSxuVI2f3kN6ip/Wf+6i8N44= X-Google-Smtp-Source: AGHT+IG/2FWmLGV/cSpdJq6dTzeG1HvvPaiIw2IUETlB51ICtqFzmW5NZIS6/AZpS1XdCZHkod6GNrCqVQllAnx0N9Y= X-Received: by 2002:a05:6512:3042:b0:50e:d4d2:8c0f with SMTP id b2-20020a056512304200b0050ed4d28c0fmr1202381lfb.113.1705832454953; Sun, 21 Jan 2024 02:20:54 -0800 (PST) MIME-Version: 1.0 References: <83jzvdijbb.fsf@gnu.org> <86pm4usb45.fsf_-_@mail.linkov.net> <86351m8lqu.fsf@mail.linkov.net> <83fryrs1l8.fsf@gnu.org> <87edebjcku.fsf@gmail.com> <835xznro5i.fsf@gnu.org> In-Reply-To: <835xznro5i.fsf@gnu.org> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Sun, 21 Jan 2024 10:20:46 +0000 Message-ID: Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62606 Cc: hugo@heagren.com, 62606@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, Jan 21, 2024 at 10:12=E2=80=AFAM Eli Zaretskii wrote= : > Thanks, but I don't want to expose the tail of the mode-line to Lisp, > let alone do it on every iteration through mode-line-format. Why? From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 21 05:28:17 2024 Received: (at 62606) by debbugs.gnu.org; 21 Jan 2024 10:28:17 +0000 Received: from localhost ([127.0.0.1]:36670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRV3o-0007bn-Mk for submit@debbugs.gnu.org; Sun, 21 Jan 2024 05:28:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRV3l-0007bR-2h for 62606@debbugs.gnu.org; Sun, 21 Jan 2024 05:28:15 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRV3a-0002mv-R8; Sun, 21 Jan 2024 05:28:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=+iifO34hWcUmC3MhotG0/LkNM9XJT2utE9V5S2je2cU=; b=J4hUVYTfZ9OivombDTZq WZwrKX0tVyb/dIHop56H7ExvzxJriAi4vfGWn/yDyUCxLzZdsI3y30cvnKPBm0YxgT6XCMV7Sz+JM wj0/jKzOsEPNUp9iZ/lD9MOdhJhimv4F2GIJ1yLvXcwIptKts6VYwCFReRHNqm07qKVBpD9KGc6CO zrbob8Fk52IYz/pkc5+o/SyQL/MirD2YtwOVdgzCOyRTOBCyZtB6OANo0eGCrhFxoYTKsFcfn82nH myBxbbYRBtg3eayXcBZ0kP0FvINmmuelNfBOTXYQqsrkXN6Hji17ormC6Mi2OXzE6sp8DoSUChyYY dsJKBaEyxy+bIA==; Date: Sun, 21 Jan 2024 12:27:46 +0200 Message-Id: <831qabrnfh.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Sun, 21 Jan 2024 10:20:46 +0000) Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right References: <83jzvdijbb.fsf@gnu.org> <86pm4usb45.fsf_-_@mail.linkov.net> <86351m8lqu.fsf@mail.linkov.net> <83fryrs1l8.fsf@gnu.org> <87edebjcku.fsf@gmail.com> <835xznro5i.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62606 Cc: hugo@heagren.com, 62606@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: João Távora > Date: Sun, 21 Jan 2024 10:20:46 +0000 > Cc: juri@linkov.net, hugo@heagren.com, 62606@debbugs.gnu.org > > On Sun, Jan 21, 2024 at 10:12 AM Eli Zaretskii wrote: > > > Thanks, but I don't want to expose the tail of the mode-line to Lisp, > > let alone do it on every iteration through mode-line-format. > > Why? Because I have more than enough gray hair from debugging and fixing problems related to this stuff, including the mode-line-format-right-align itself and the issues it causes. I was (mildly) against installing this feature, for the same reason, and I certainly won't agree to let this particular tail to wag the dog any more than it already has. It's bad enough to have a non-trivial display feature that is not maintained by anyone; adding more features to it is really too much. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 21 05:40:13 2024 Received: (at 62606) by debbugs.gnu.org; 21 Jan 2024 10:40:13 +0000 Received: from localhost ([127.0.0.1]:36679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRVFN-0002Bs-5x for submit@debbugs.gnu.org; Sun, 21 Jan 2024 05:40:13 -0500 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:50393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRVFJ-0002Ba-KX for 62606@debbugs.gnu.org; Sun, 21 Jan 2024 05:40:11 -0500 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2ccb4adbffbso23705291fa.0 for <62606@debbugs.gnu.org>; Sun, 21 Jan 2024 02:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705833600; x=1706438400; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UXV8Iuf/bn53z4aDa6FfxjakgcgwPxXG1I8xr5aFhQ4=; b=ba/RHxNAAcmsx+KfwejLnNs+K+oXRMTWOk9CyGk9UFDFh5N+VPF2m5b2QP7uBF57di vwrBmyn8CRW8OMCuM+hp1EQBXiG3RCmEaCcCjLFGhBlNTag1CScFAN5rGHiipeb3Trjs oyttVJCsOohuOBYfFOup8pECR3RD6WKUkQjb3xF+MeLxiDGkIAWK/4Rr8aSltzcdwPjZ qQLlCAHvY5RsrwXyCMZVuzuiCWAfK/6gRQ2YuRTz+GvoqIZ4yGVer+fH2AsbekuFNOZN Pp/CAlVwAae166PGUDf/QDEYHPeQ9AI6gD7PKMvU/o/zcBU43rUf0ZTI9qXmBpSjVYRX JhCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705833600; x=1706438400; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UXV8Iuf/bn53z4aDa6FfxjakgcgwPxXG1I8xr5aFhQ4=; b=bQ4KUiGxMi1IidT4Q7c48QwBPNeJsEd46pfixBqUSSBbUYh/2CJHswHDEXMR+dS22Q RP3jrbrBlZAyAsBoFMIxhOjXJtwa8u7f7Pp+VXMI87Af2qe1MTk21Ri7UfW4Ympy2afV 3YrqomsCWRYB6ukGbzZ9SP0W2JwFVWBhNI+CPDPa/JauPo7gWkHM1z4SUvxILWMTcsL5 P2/oje7Y++k2PUGr4UiULFm/Fh4/J2K86vYvyJ9a0TFpvKOIMBk+X9CBWCEvB3NKrgqP H63FL8oPzu/2myavYpJcWulayF5/jYEAMkh9atCFvFq+AdGzdcK7gwrKP7C2QNUCfDKW kUHw== X-Gm-Message-State: AOJu0YxNfTRH9ybGFV3+sGPpxtxMjHC77WvkPN3VCSO7aHurj4Ep1FD4 RjIBaOLOe0Xdm9GYANMITKOJu3TFdnl9IWSjDMQICT3wx7k/ZmYNLB6MRH9gkiZyxbqMcngjU0Y /qcvIkjriE7c/H1EQnViBmuQbHzotsGHU X-Google-Smtp-Source: AGHT+IGMIhjJN4ebrxFG4r2GzkP51/9SNtitl5obpbeJjneRX9curXbXLrZEcZcjhy70qpEAOy08C5dTi74KzxSXkoY= X-Received: by 2002:a2e:9884:0:b0:2cc:69f5:de89 with SMTP id b4-20020a2e9884000000b002cc69f5de89mr858112ljj.37.1705833600081; Sun, 21 Jan 2024 02:40:00 -0800 (PST) MIME-Version: 1.0 References: <83jzvdijbb.fsf@gnu.org> <86pm4usb45.fsf_-_@mail.linkov.net> <86351m8lqu.fsf@mail.linkov.net> <83fryrs1l8.fsf@gnu.org> <87edebjcku.fsf@gmail.com> <835xznro5i.fsf@gnu.org> <831qabrnfh.fsf@gnu.org> In-Reply-To: <831qabrnfh.fsf@gnu.org> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Sun, 21 Jan 2024 10:39:51 +0000 Message-ID: Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 62606 Cc: hugo@heagren.com, 62606@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, Jan 21, 2024 at 10:28=E2=80=AFAM Eli Zaretskii wrote= : > > > From: Jo=C3=A3o T=C3=A1vora > > Date: Sun, 21 Jan 2024 10:20:46 +0000 > > Cc: juri@linkov.net, hugo@heagren.com, 62606@debbugs.gnu.org > > > > On Sun, Jan 21, 2024 at 10:12=E2=80=AFAM Eli Zaretskii w= rote: > > > > > Thanks, but I don't want to expose the tail of the mode-line to Lisp, > > > let alone do it on every iteration through mode-line-format. > > > > Why? > > Because I have more than enough gray hair from debugging and fixing > problems related to this stuff, including the > mode-line-format-right-align itself and the issues it causes. I was > (mildly) against installing this feature, for the same reason, and I > certainly won't agree to let this particular tail to wag the dog any > more than it already has. It's bad enough to have a non-trivial > display feature that is not maintained by anyone; adding more features > to it is really too much. Right. But any technical arguments? What's the difference between solving this in Lisp, which you would accept, and solving this in C+Lisp? It's a two line change like a zillion others just one of the lines happens to be a single assignment in C. I can offer to maintain this feature, or the whole display_mode_element & friends. Any other grey-hair inducing outstanding bugs (apart from this one I've found). Jo=C3=A3o From unknown Wed Aug 20 04:11:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 18 Feb 2024 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator