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#46476: Feature request: Right-aligning part of the modeline Date: Sat, 13 Feb 2021 18:58:59 +0200 Message-ID: <83a6s7dhv0.fsf@gnu.org> References: <83ft20e5z0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1653"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46476@debbugs.gnu.org To: =?UTF-8?Q?Pawe=C5=82_?= =?UTF-8?Q?Kra=C5=9Bnicki?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 13 18:01:51 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAyIo-0000ME-Sx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 18:01:50 +0100 Original-Received: from localhost ([::1]:54272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAyIn-0002lV-Rk for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 12:01:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAyH4-0002Rj-Ho for bug-gnu-emacs@gnu.org; Sat, 13 Feb 2021 12:00:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lAyH4-0006DB-8u for bug-gnu-emacs@gnu.org; Sat, 13 Feb 2021 12:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lAyH4-0007vr-6P for bug-gnu-emacs@gnu.org; Sat, 13 Feb 2021 12:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Feb 2021 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46476 X-GNU-PR-Package: emacs Original-Received: via spool by 46476-submit@debbugs.gnu.org id=B46476.161323555030399 (code B ref 46476); Sat, 13 Feb 2021 17:00:02 +0000 Original-Received: (at 46476) by debbugs.gnu.org; 13 Feb 2021 16:59:10 +0000 Original-Received: from localhost ([127.0.0.1]:34977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lAyGD-0007uF-MH for submit@debbugs.gnu.org; Sat, 13 Feb 2021 11:59:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lAyGB-0007tW-R1 for 46476@debbugs.gnu.org; Sat, 13 Feb 2021 11:59:08 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52763) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAyG6-0005ra-J4; Sat, 13 Feb 2021 11:59:02 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3957 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lAyG4-000266-1p; Sat, 13 Feb 2021 11:59:01 -0500 In-Reply-To: (message from =?UTF-8?Q?Pawe=C5=82_?= =?UTF-8?Q?Kra=C5=9Bnicki?= on Sat, 13 Feb 2021 17:30:16 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199941 Archived-At: > From: Paweł Kraśnicki > Date: Sat, 13 Feb 2021 17:30:16 +0100 > Cc: 46476@debbugs.gnu.org > > > Can you describe how is this done in Lisp? > > Sure. The most common solution is to use a text property that displays a space > with the `:align-to' property. Here's a simplified version of the code from the > popular `powerline' package: If people use :align-to, then what would be the advantage of providing %-constructs to produce the same? > > The immediate question about this I have is what to do when the > > mode-line string is too long for the window's width? Right now, we > > simply chop the stuff on the right that doesn't fit, but if the > > mode-line string has 2 or 3 different part, that should be revised, > > right? > > I'm not sure. With the current Lisp solutions, the modeline gets chopped on the > right too, and it seems that people either don't mind that at all, or they use > custom "segment" logic. The idea here is that the modeline is composed of a few > segments, with each having a priority number. As the window shrinks, the > segments get hidden in discrete jumps starting from the lowest priority, until > only the segment(s) with the highest priority number remain. I think there may > not be any demand for an intermediate solution that would let the user configure > hiding with granularity of left/center/right. That'd require two passes to generate the mode-line display, right?