From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62606: [PATCH] function to align mode-line elements to right Date: Fri, 09 Jun 2023 16:13:06 +0300 Message-ID: <83ilbw22zh.fsf@gnu.org> References: <83355iygw3.fsf@gnu.org> <83mt2hfrr4.fsf@gnu.org> <4b872ecc12e3995d5b7dfffa580e297d@heagren.com> <83zg5c3kbo.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7152"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62606@debbugs.gnu.org To: hugo@heagren.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 09 16:37:39 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 1q7dFB-0001ZV-I3 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Jun 2023 16:37:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7bwK-0006Rk-RJ; Fri, 09 Jun 2023 09:14:04 -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 1q7bwI-0006RI-P2 for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 09:14: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 1q7bwI-0007gC-FI for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 09:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q7bwI-0001NK-AM for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 09:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jun 2023 13:14: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.16863163865211 (code B ref 62606); Fri, 09 Jun 2023 13:14:02 +0000 Original-Received: (at 62606) by debbugs.gnu.org; 9 Jun 2023 13:13:06 +0000 Original-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 Original-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 Original-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==; Original-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 In-Reply-To: (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:263161 Archived-At: > 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.