unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: contovob@tcd.ie, 34476@debbugs.gnu.org
Subject: bug#34476: fluffy whitespace in the mode-line, despite it running off the screen
Date: Tue, 29 Dec 2020 17:02:29 +0200	[thread overview]
Message-ID: <83czysk64a.fsf@gnu.org> (raw)
In-Reply-To: <871rf9gtbx.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue,  29 Dec 2020 04:54:42 +0100)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: contovob@tcd.ie,  34476@debbugs.gnu.org
> Date: Tue, 29 Dec 2020 04:54:42 +0100
> 
> I've now gone ahead and polished up this a bit (and introduced the
> `long' setting, too).  After using it for a while, I see the obvious
> thing that `format-mode-line' does wrong -- it discards all text
> properties?  So I'll open a new bug report for that, and I'm closing
> this bug report.

Hmm... does the test below really work reliably on GUI frames?

> +      if (EQ (Vmode_line_compact, Qlong)
> +         && window_body_width (XWINDOW (selected_window), false) >=
> +         SCHARS (mode_string))
> +       {
> +         /* The window is wide enough; just display the mode line we
> +            just computed. */
> +         display_string (NULL, mode_string, Qnil,
> +                         0, 0, &it, 0, 0, 0,
> +                         STRING_MULTIBYTE (mode_string));

You are comparing the number of characters with the window-body width,
but the latter is measured in units of the frame's canonical character
width, i.e. the average width of the default face's font.  If someone
modifies the mode-line face to use a font of a different size, or even
has enough wide characters there to violate the "1 character = 1
column" assumption, that test will produce either truncated mode-line
string or will unnecessarily squeeze spaces from it.

I understand the difficulty of doing TRT, but perhaps we should at
least document this limitation, so that users don't expect too much
from this feature, and we don't get bug reports that will be hard to
fix?





  reply	other threads:[~2020-12-29 15:02 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 13:34 bug#34476: fluffy whitespace in the mode-line, despite it running off the screen 積丹尼 Dan Jacobson
2019-07-09 16:43 ` Lars Ingebrigtsen
2019-07-09 20:46   ` Basil L. Contovounesios
2019-07-09 21:44     ` Lars Ingebrigtsen
2020-08-07  8:00       ` Lars Ingebrigtsen
2020-08-07  8:31         ` Lars Ingebrigtsen
2020-08-07 11:32           ` Eli Zaretskii
2020-08-07 11:41             ` Lars Ingebrigtsen
2020-08-07 11:59               ` Eli Zaretskii
2020-08-07 12:15                 ` Lars Ingebrigtsen
2020-08-07 13:52                   ` Eli Zaretskii
2020-08-08  9:11                     ` Lars Ingebrigtsen
2020-08-08  9:48                       ` Eli Zaretskii
2020-08-08 10:01                         ` Eli Zaretskii
2020-08-08 11:18                           ` Lars Ingebrigtsen
2020-08-08 12:55                             ` Eli Zaretskii
2020-08-08 14:16                               ` Lars Ingebrigtsen
2020-08-08 15:00                                 ` Eli Zaretskii
2020-08-09  9:56                                   ` Lars Ingebrigtsen
2020-08-09 14:07                                     ` Eli Zaretskii
2020-08-10 14:46                                       ` Eli Zaretskii
2020-08-10 14:56                                         ` Lars Ingebrigtsen
2020-08-14 10:46                                         ` Eli Zaretskii
2020-08-14 12:00                                           ` Lars Ingebrigtsen
2020-08-14 13:16                                             ` Eli Zaretskii
2020-08-15  8:47                                           ` Eli Zaretskii
2020-08-15 10:55                                             ` Lars Ingebrigtsen
2020-08-15 15:12                                               ` Eli Zaretskii
2020-08-16 11:21                                                 ` Lars Ingebrigtsen
2020-08-16 14:43                                                   ` Eli Zaretskii
2020-08-17  8:33                                                     ` Lars Ingebrigtsen
2020-08-17 14:17                                                       ` Eli Zaretskii
2020-12-29  3:54                                                         ` Lars Ingebrigtsen
2020-12-29 15:02                                                           ` Eli Zaretskii [this message]
2020-12-29 15:07                                                             ` Lars Ingebrigtsen
2020-12-29 15:54                                                               ` Eli Zaretskii
2020-12-29 17:04                                                                 ` martin rudalics
2020-12-30  2:36                                                                   ` Lars Ingebrigtsen
2020-08-08 11:18                         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83czysk64a.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=34476@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).