GNU bug report logs - #72309
propertized-buffer-identification with maximum width

Previous Next

Package: emacs;

Reported by: Heime <heimeborgia <at> protonmail.com>

Date: Fri, 26 Jul 2024 19:05:01 UTC

Severity: normal

Tags: notabug

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #25 received at 72309 <at> debbugs.gnu.org (full text, mbox):

From: Heime <heimeborgia <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72309 <at> debbugs.gnu.org
Subject: Re: bug#72309: propertized-buffer-identification with maximum width
Date: Sat, 27 Jul 2024 13:08:31 +0000
On Sunday, July 28th, 2024 at 1:00 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Sat, 27 Jul 2024 12:23:20 +0000
> > From: Heime heimeborgia <at> protonmail.com
> > Cc: 72309 <at> debbugs.gnu.org
> > 
> > Sent with Proton Mail secure email.
> > 
> > On Sunday, July 28th, 2024 at 12:05 AM, Eli Zaretskii eliz <at> gnu.org wrote:
> > 
> > > > Date: Sat, 27 Jul 2024 09:22:21 +0000
> > > > From: Heime heimeborgia <at> protonmail.com
> > > > Cc: 72309 <at> debbugs.gnu.org
> > > > 
> > > > On Saturday, July 27th, 2024 at 5:48 PM, Eli Zaretskii eliz <at> gnu.org wrote:
> > > > 
> > > > > tags 72309 notabug
> > > > > thanks
> > > > > 
> > > > > > Date: Fri, 26 Jul 2024 19:04:14 +0000
> > > > > > From: Heime via "Bug reports for GNU Emacs,
> > > > > > the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org
> > > > > > 
> > > > > > propertized-buffer-identification could be improved so that when using a
> > > > > > maximum width there are three dots and a space at the end to indicate
> > > > > > that the buffer name has been truncated.
> > > > > 
> > > > > Emacs doesn't truncate the buffer name shown on the mode line, so no
> > > > > ellipsis should be needed, ever. IOW, the maximum width is basically
> > > > > infinity.
> > > > > 
> > > > > Where did you see the buffer name truncated on the mode line?
> > > > 
> > > > There is this construct
> > > > 
> > > > (width rest…)
> > > > 
> > > > which specifies truncation or padding of the results of rest.
> > > > 
> > > > If used on the buffer name it just truncates without specification
> > > > that truncation occurred.
> > > 
> > > Where in the Emacs code did you see that? I cannot find anything like
> > > that in bindings.el, which is where we have the code used for
> > > displaying the buffer name on the mode line.
> > 
> > The last entry in "24.4.2 The Data Structure of the Mode Line".
> > 
> > I have tried it and setting a maximum width does work and the abrupt
> > truncation in the buffer name does occur.
> 
> 
> Yes, but the (WIDTH something) construct is not for truncating long
> names, it's for ensuring the string produced by "something" doesn't
> take too many columns. So you are using this for a wrong purpose. If
> you want to truncate a buffer's name, use truncate-string-to-width
> instead, which is also capable of showing the ellipsis at the end.

I do not know how to access the buffer name and apply truncate-string-to-width
when setting mode-line-buffer-identification on propertized-buffer-identification.

It is a very difficult thing.





This bug report was last modified 141 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.