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


View this message in rfc822 format

From: Heime <heimeborgia <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72309 <at> debbugs.gnu.org
Subject: bug#72309: propertized-buffer-identification with maximum width
Date: Sat, 27 Jul 2024 14:56:21 +0000




Sent with Proton Mail secure email.

On Sunday, July 28th, 2024 at 1:29 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Date: Sat, 27 Jul 2024 13:08:31 +0000
> > From: Heime heimeborgia <at> protonmail.com
> > Cc: 72309 <at> debbugs.gnu.org
> > 
> > On Sunday, July 28th, 2024 at 1:00 AM, Eli Zaretskii eliz <at> gnu.org wrote:
> > 
> > > 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.
> 
> 
> Use :eval.

I have done it without success

(defun vodil-rtgbfn (wmin)
  (setq-default mode-line-buffer-identification
    (propertized-buffer-identification (format " %%%db " wmin))))

 (vodil-rtgbfn 8)

  (setq-default mode-line-format
    '( "%e" (:eval (truncate-string-to-width mode-line-buffer-identification 13))
            vodil-panelit-bfselec))







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.