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

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

bug#24972: 26.0.50; Multibyte characters are misaligned in ibuffer


From: Mark Oteiza
Subject: bug#24972: 26.0.50; Multibyte characters are misaligned in ibuffer
Date: Tue, 22 Nov 2016 02:49:22 -0500
User-agent: Mutt/1.7.1+41 (5382e1e4cee1) (2016-10-04)

On 22/11/16 at 02:54pm, Liu Hui wrote:
> 
> 在 2016年11月22日 13:12, Mark Oteiza 写道:
> > On 22/11/16 at 11:51am, Liu Hui wrote:
> > > Thank you, but the trailing "..." is missing for long buffer names, no
> > > matter whether they contain multibyte characters. For example,
> > > "01234567890123456789" becomes "012345678901234567". The normal result
> > > should be "012345678901234...".
> > 
> > Would you try the following?
> > 
> > diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
> > index faadb67..c550b7d 100644
> > --- a/lisp/ibuffer.el
> > +++ b/lisp/ibuffer.el
> > @@ -1559,16 +1559,17 @@ ibuffer-compile-make-eliding-form
> >               `(concat ,ellipsis
> >                        (substring ,strvar
> >                                   (string-width ibuffer-eliding-string)))
> > -           `(truncate-string-to-width
> > -             ,strvar strlen nil nil
> > -             ,ellipsis))
> > +           `(concat
> > +             (truncate-string-to-width
> > +                   ,strvar (- strlen (string-width ,ellipsis)) nil ?.)
> > +                  ,ellipsis))
> >        ,strvar)
> >        strvar)))
> > 
> >  (defun ibuffer-compile-make-substring-form (strvar maxvar from-end-p)
> >    (if from-end-p
> > -      `(truncate-string-to-width str (string-width str) (- strlen ,maxvar))
> > -    `(truncate-string-to-width ,strvar ,maxvar)))
> > +      `(truncate-string-to-width str (string-width str) (- strlen ,maxvar) 
> > nil ?\s)
> > +    `(truncate-string-to-width ,strvar ,maxvar nil ?\s)))
> > 
> >  (defun ibuffer-compile-make-format-form (strvar widthform alignment)
> >    (let* ((left `(make-string tmp2 ?\s))
> > 
> 
> It works very well. Thank you.

Wahoo! Pushed, thanks.





reply via email to

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