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: Sat, 06 May 2023 17:39:59 +0300 Message-ID: <83mt2hfrr4.fsf@gnu.org> References: <83355iygw3.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23968"; 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 Sat May 06 16:40:19 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 1pvJ59-00062k-JL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 May 2023 16:40:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvJ4u-0000NJ-Vj; Sat, 06 May 2023 10:40: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 1pvJ4s-0000N0-BF for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 10:40:02 -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 1pvJ4s-0004fJ-3X for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 10:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvJ4r-0002zm-U1 for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 10:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 May 2023 14:40:01 +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.168338395411439 (code B ref 62606); Sat, 06 May 2023 14:40:01 +0000 Original-Received: (at 62606) by debbugs.gnu.org; 6 May 2023 14:39:14 +0000 Original-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 Original-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 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 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==; 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 1pvJ3v-0002el-F4; Sat, 06 May 2023 10:39:03 -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:261199 Archived-At: > 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?