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 #49 received at 72309 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Heime <heimeborgia <at> protonmail.com>
Cc: 72309 <at> debbugs.gnu.org
Subject: Re: bug#72309: propertized-buffer-identification with maximum width
Date: Sun, 28 Jul 2024 15:29:21 +0300
> Date: Sun, 28 Jul 2024 12:18:32 +0000
> From: Heime <heimeborgia <at> protonmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 72309 <at> debbugs.gnu.org
> 
> > > > What is the big problem of showing how to implement this, buffer name
> > > > with truncation ellipses using mode-line-buffer-identification ?
> > > 
> > > We don't have people here whose job is to write code for others. This
> > > is a volunteer-based project, where people help you with ideas, but
> > > the actual job of writing and debugging the code is yours.
> > > 
> > > So please take the ideas, read the documentation, and work on the
> > > implementation you want. If you have questions about the
> > > implementation, please ask them on help-gnu-emacs, which is where
> > > user-level help should be sought.
>  
> The implementations do not work.  
> 
> For instance, using 
> 
> (name (buffer-name))
> 
> or with 
> 
> (buffer-name (window-buffer))
> 
> See
> 
> (setq-default mode-line-buffer-identification
>   (propertized-buffer-identification
>     (format " %s "
>       (let ( (name (buffer-name)) )
>          (if (> (length name) wmax)
>          (concat (substring name 0 (- wmax 3)) "...")
>          name))))) )
> 
> And neither does this
> 
>   (let* ( (bfname (buffer-name (window-buffer)))
>           (tkname (if (> (length bfname) wmax)
>                       (truncate-string-to-width bfname wmax nil nil "...")
>                     bfname)))
>     (propertized-buffer-identification (format " %s " tkname))))
> 
> So there is no option other than using %b, where one has no control about
> how it gets displayed. 

Your conclusions are wrong.




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.