GNU bug report logs - #24972
26.0.50; Multibyte characters are misaligned in ibuffer

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Liu Hui <liuhui1610 <at> gmail.com>
To: Mark Oteiza <mvoteiza <at> udel.edu>
Cc: 24972 <at> debbugs.gnu.org
Subject: bug#24972: 26.0.50; Multibyte characters are misaligned in ibuffer
Date: Tue, 22 Nov 2016 11:51:50 +0800
在 2016年11月21日 17:35, Mark Oteiza 写道:
> On 21/11/16 at 02:00pm, Liu Hui wrote:
>> 在 2016年11月21日 02:58, Mark Oteiza 写道:
>>> Liu Hui <liuhui1610 <at> gmail.com> writes:
>>>> As shown in the screenshot attached, multibyte characters (the second
>>>> line) are misaligned in ibuffer. The problem seems at least relevant
>>>> to the function `ibuffer-compile-format', which uses `length' rather
>>>> than `string-width' for characters.
>>>
>>> Indeed, changing to string-width improves it. ibuffer should probably
>>> also be using display properties to align the columns, but that's
>>> another issue.
>>>
>>> Committed in 7e2a8b1. Thanks for reporting
>>
>> Thank you, but I find it does not work when the multibyte string is long.
>> For example, if the string-width of buffer name, e.g.
>> "一个很长很长的文件名", exceeds the default width of ibuffer column, M-x
>> ibuffer will fail and issue an error.
>>
>> According to the backtrace, it is because `ibuffer-compile-format' calls
>> `ibuffer-compile-make-substring-form'/`ibuffer-compile-make-eliding-form',
>> which use `substring' to truncate the multibyte string. A similar issue was
>> reported in https://github.com/emacs-helm/helm/issues/170. Probably
>> replacing `substring' solves the problem.
>
> Ah, thanks. I pushed another change that fixes the error.  Still, if the
> name is a particular mix of half- and full-width though (e.g.
> "aーーーーーー"), the next column(s) might be off by one.
>

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...".




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.