help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Operation of format-mode-line


From: Heime
Subject: Re: Operation of format-mode-line
Date: Sun, 28 Jul 2024 16:53:35 +0000





Sent with Proton Mail secure email.

On Monday, July 29th, 2024 at 4:14 AM, Heime <heimeborgia@protonmail.com> wrote:

> 
> 
> 
> 
> 
> Sent with Proton Mail secure email.
> 
> 
> On Monday, July 29th, 2024 at 3:30 AM, Manuel Giraud via Users list for the 
> GNU Emacs text editor help-gnu-emacs@gnu.org wrote:
> 
> > Heime heimeborgia@protonmail.com writes:
> > 
> > [...]
> > 
> > > Nothing suggested actually solves the problem. So there must get some
> > > fixes to allow the possibilities people think should happen.
> > 
> > Hi,
> > 
> > I'm replying here because a debbugs is not the place.
> > 
> > You were almost there with this piece of code:
> > --8<---------------cut here---------------start------------->8---
> > 
> > (defun vodil-tkbfn-ellipses (wmax)
> > "Get the buffer name truncated to WMAX width with ellipsis."
> > 
> > (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))))
> > 
> > (defun vodil-tkbfn (wmax)
> > "Set mode-line-buffer-identification with WMAX maximum width."
> > 
> > (setq-default mode-line-buffer-identification
> > '(:eval (vodil-tkbfn-ellipses wmax))))
> > --8<---------------cut here---------------end--------------->8---
> > 
> > ... but you have an error in your last line. What do you get when you
> > do 'M-: mode-line-buffer-identification'?
> > --
> > Manuel Giraud

I got this 

Error during redisplay: 
(eval (prevodilac-tkbfn-ellipses wmax)) signaled (void-variable wmax) [77 times]
 
I do (vodil-tkbfn 8) after the function declaration
 
(defun vodil-tkbfn (wmax)
  (setq-default mode-line-buffer-identification
    '(:eval (vodil-tkbfn-ellipses wmax))))
 
(vodil-tkbfn 8)
 
(setq-default mode-line-format
  '( "%e"
          (:eval (if vodil-deploy-bfname
                       vodil-panelit-bfname
                   mode-line-buffer-identification))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]