GNU bug report logs -
#24972
26.0.50; Multibyte characters are misaligned in ibuffer
Previous Next
Reported by: Liu Hui <liuhui1610 <at> gmail.com>
Date: Sun, 20 Nov 2016 18:14:02 UTC
Severity: normal
Merged with 18934
Found in versions 24.4, 26.0.50
Done: Mark Oteiza <mvoteiza <at> udel.edu>
Bug is archived. No further changes may be made.
Full log
Message #28 received at 24972-done <at> debbugs.gnu.org (full text, mbox):
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.
This bug report was last modified 8 years and 166 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.