From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: hugo@heagren.com Newsgroups: gmane.emacs.bugs Subject: bug#62606: [PATCH] function to align mode-line elements to right Date: Fri, 09 Jun 2023 13:47:55 +0100 Message-ID: References: <83355iygw3.fsf@gnu.org> <83mt2hfrr4.fsf@gnu.org> <4b872ecc12e3995d5b7dfffa580e297d@heagren.com> <83zg5c3kbo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7398"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.6.0 Cc: 62606@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 09 16:37:42 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7dFG-0001gZ-Fi for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Jun 2023 16:37:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7bY9-0003Dn-Go; Fri, 09 Jun 2023 08:49:05 -0400 Original-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 1q7bY7-0003D9-8j for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 08:49:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7bY7-0002Z5-0O for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 08:49:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q7bY6-0000ke-Fv for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 08:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: hugo@heagren.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jun 2023 12:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62606 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 62606-submit@debbugs.gnu.org id=B62606.16863148842657 (code B ref 62606); Fri, 09 Jun 2023 12:49:02 +0000 Original-Received: (at 62606) by debbugs.gnu.org; 9 Jun 2023 12:48:04 +0000 Original-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 Original-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==; Original-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 In-Reply-To: <83zg5c3kbo.fsf@gnu.org> X-Sender: hugo@heagren.com 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263162 Archived-At: 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