GNU bug report logs - #4839
23.1.50; *Buffer List* -- incorrect handling of multibyte characters?

Previous Next

Package: emacs;

Reported by: stepnem <at> gmail.com

Date: Sat, 31 Oct 2009 13:55:05 UTC

Severity: minor

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Štěpán Němec <stepnem <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 4839 <at> debbugs.gnu.org
Subject: bug#4839: 23.1.50; *Buffer List* -- incorrect handling of multibyte characters?
Date: Mon, 2 Nov 2009 16:55:45 +0100
On Mon, Nov 02, 2009 at 04:40:19PM +0100, Andreas Schwab wrote:
> Štěpán Němec <stepnem <at> gmail.com> writes:
> 
> > On Mon, Nov 02, 2009 at 04:08:16AM -0500, Glenn Morris wrote:
> >> stepnem <at> gmail.com wrote:
> >> 
> >> > Here is a part of my *Buffer List*:
> >> >
> >> >     desktop-menu.el      20228  Emacs-Lisp        ~/.emacs.d/load/desktop-menu.el
> >> [...]
> >> >     面無人色.org         11681  Org               ~/Documents/ling/cn/面無人色.org
> >> >     xhc.org               1833  Org               ~/Documents/ling/cn/xhc.org
> >> >     词典.org              2940  Org               ~/Documents/ling/cn/词典.org
> >> [...]
> >> > All the `Org' lines, with exception of `xhc.org', are misaligned.
> >> 
> >> When I copy and paste your buffer names, the issue seems to be that
> >> `string-width' returns an incorrect value (eg 13 when the buffer name
> >> actually seems to occupy 12). Although some of these characters seem
> >> to have a non-integer width on my system, so I don't see that it is
> >> possible to get this right. But it still looks more wrong than it
> >> should be (off by > 1 character).
> >
> > Yes -- when I view your quotation from my mail above in Mutt, it's
> > aligned correctly, but as soon as I cut & paste it into an Emacs buffer,
> > it's misaligned again, the exact same way as displayed in the *Buffer List*...
> 
> If the double width characters are not exactly twice as wide as the
> single width characters there is not much that can be done about that.

Indeed, that's what I just realized, too :-)

Probably not much, apart from making Emacs smarter in choosing fonts that do
align properly (i.e. the widths are multiples of some common base).
I'm not sure how other GUI apps go about that... but I'm guessing there
must be ways to align columns properly even in cases like this one -- after
all, there are other than mono-spaced fonts, so the common base might in
fact not be a necessary condition...?



This bug report was last modified 15 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.