From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#34476: fluffy whitespace in the mode-line, despite it running off the screen Date: Fri, 07 Aug 2020 10:00:35 +0200 Message-ID: <87eeoi7un0.fsf@gnus.org> References: <87lg2icx3u.fsf@jidanni.org> <87ftnfrwef.fsf@mouse.gnus.org> <87r26z0wdy.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28618"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 34476@debbugs.gnu.org, =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 07 10:01:59 2020 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 1k3xKA-0007KM-Va for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Aug 2020 10:01:59 +0200 Original-Received: from localhost ([::1]:52756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3xK9-0001Jq-RX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Aug 2020 04:01:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3xJG-0000MV-2F for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2020 04:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3xJF-0000NI-Ld for bug-gnu-emacs@gnu.org; Fri, 07 Aug 2020 04:01:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k3xJF-00015B-JA; Fri, 07 Aug 2020 04:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Fri, 07 Aug 2020 08:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34476 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 34476-submit@debbugs.gnu.org id=B34476.15967872534138 (code B ref 34476); Fri, 07 Aug 2020 08:01:01 +0000 Original-Received: (at 34476) by debbugs.gnu.org; 7 Aug 2020 08:00:53 +0000 Original-Received: from localhost ([127.0.0.1]:55624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3xJ6-00014g-W5 for submit@debbugs.gnu.org; Fri, 07 Aug 2020 04:00:53 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:35888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3xJ2-00014O-0V for 34476@debbugs.gnu.org; Fri, 07 Aug 2020 04:00:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From: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=/mMeJkjb+Xnm4ViBTu3RrSlGavAKHgAxOkFZdipncz8=; b=CatPQ6kHYQjQDcrqL8tzXbWRoR ToPaeNyfXZXHAUQjFXxUCL2Zf4FET75A14un6Hxe7jRauUhURIhU5hPh0yPEGXf5X0jG9cPPLvu0F guUU9msbE0FlqQpqAfcoWVGtTErFaYc4OQGTmnHsoiHgCd+B98CxsREKXOkr2ttDcpBE=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3xIr-0004Pq-9B; Fri, 07 Aug 2020 10:00:41 +0200 In-Reply-To: (Lars Ingebrigtsen's message of "Tue, 09 Jul 2019 23:44:16 +0200") 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:184234 Archived-At: Lars Ingebrigtsen writes: > "Basil L. Contovounesios" writes: > >> Instead of, or in addition to, a user option, perhaps a new mode line >> construct would be more general. There is already a way to specify a >> minimum field width, for example, so perhaps it would be possible to >> also specify a maximum default width. > > Do you mean on a per-field basis? Hm... I'm not sure that's generally > useful -- when chopping down a field, there's often field-specific ways > to shorten things (i.e., just chopping the ends off of things isn't > always the best thing to do). > > But in any case, it's orthogonal to whether to compact the white space, > which entails no information loss and can be done generally. I think. I had a look at this, thinking that this would be easy to implement. We could have, for instance, a variable like `mode-line-compact' that would default to nil (current behaviour), t (always compact) and `long' (compact if the mode line is wider than the window size). However, the mode line generation is done in a very low-level manner -- in display_mode_element. And it calls display_string directly for each element? If I'm reading the code correctly? static int display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) [...] mode_line_target = MODE_LINE_DISPLAY; Yeah, I think so. So it doesn't create a string, and then display it, so there's really no way to post-process the entire string before it's displayed, I think? Which makes this rather difficult to implement. Hm... well, since this is an optional thing users can switch on, perhaps making it slightly slower wouldn't be that much of a problem. Let's see... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no