GNU bug report logs -
#1808
23.0.60; picture-mode not considering double-width characters alignment
Previous Next
Reported by: poppyer <poppyer <at> gmail.com>
Date: Tue, 6 Jan 2009 17:15:03 UTC
Severity: normal
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Alan J Third <alan <at> idiocy.org>
> Date: Sat, 09 Jan 2016 22:43:36 +0000
> Cc: 1808 <at> debbugs.gnu.org
>
> > This is not a new bug of EMACS 23; but it is there in EMACS22 for a
> > long time. In M-x picture-mode, emacs acts in a "replace" typing
> > mode, i.e. when you type a char, it replace the old one such that the
> > alignment is maintained.
> >
> > But when mixing with double-width characters (e.g. CJK chars), one to
> > one char replacing become problematic, e.g. if we replace a
> > single-width char with a double-wdith char, the alignment will be
> > destroyed.
>
> Sorry it's taken this long for someone to get back to you.
>
> First, do you know if this is still a problem for you?
I think I still see it in the current Emacs-25 branch.
> If so, how are you entering the CJK characters?
The point is double-width characters, not necessarily CJK character,
AFAIU. There's a list of such characters in
lisp/international/character.el (search for "full-width").
Typing any of the characters for which the char-width-table entry
holds 2 should exhibit the problem.
> I find in Emacs 25 that if I try entering a greek alpha by typing:
>
> C-x 8 RET GREEK SMALL LETTER ALPHA
>
> It inserts the character, however when I bind the same character to a
> key, eg.:
>
> (global-set-key (kbd "C-c a") "α")
>
> and enter it that way it works as expected.
Yes, binding it to a key is the way to go. And when inserting such a
character, it looks like picture-mode does TRT: you will see in
picture-insert that it looks at the character width. But I think the
bug report is not about inserting double-width characters, it's about
replacing them with a single-width character. If I type a
double-width character, the alignment is kept reasonably well
("reasonably" because the double-width characters don't always take up
exactly twice the number of pixels of a single-width character, the
exact ration depends on the font being used for the double-width
character). To keep the alignment, picture-insert replaces 2
single-width characters with the double-width one. However, if I then
replace it with a single-width character, the alignment is destroyed.
And I think this bug report is about that latter use case.
Thanks for working on this.
This bug report was last modified 9 years and 133 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.