<<< Date Index >>>     <<< Thread Index >>>

Re: What's needed for mutt 1.6? (wcwidth)



On Sun, Mar 04, 2007 at 07:18:14PM +0900,
 TAKAHASHI Tamotsu wrote:

> I'm for it, as MLTerm has "col_size_of_width_a" option
> and vim has "ambwidth". But I have several questions:
> 
> 1. What is legacy_ja?
> Most of your code is clean, but the only thing I can't
> understand is legacy_ja. Isn't there any side effect?
> Why don't you just make it optional, e.g.
> $more_widechars="00A2:00A3:00A5:00A6:00AC:00AF:2212"?
> I think this is better than hard-coding them, though
> much slower. Or am I missing something?

The conversion table of most iconv refers to the following table for Japanese.
ftp://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0208.TXT
It is necessary to treat the character as Wide, Fullwidth, or Ambiguous 
in this table. 
However, some of the above-mentioned character have been treated 
as Narrow or Neutral in the following table. 
ftp://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
Therefore, lagacy_ja need not be customized, and is additional as 
the bugfix to the table. 

> 2. Why not use macros for mutt_strwidth/_tree?
> Mutt calls mutt_strwidth very often. What about macros?
> #define mutt_strwidth(s) _mutt_strwidth(s,0)
> #define mutt_strwidth_tree(s) _mutt_strwidth(s,1)
 
Your idea is good.

> 3. Can't we special-case East Asian Ambiguous class?
> Many users are using their system's wcwidth instead of
> mutt's one at this moment. So I don't think it is good
> to use mutt's wcwidth by default. Instead, what about
> using system's wcwidth after checking Ambiguous in mutt?
> Of cource this requires many s/wcwidth/mutt_wcwidth/g,
> but it worth the effort, doesn't it?

I had tried to use mutt_wcwidth() that wrapped wcwidth() before.
However, it did not go well. 
The cause is for the curses library to use wcwidth(). 
If mutt_wcwidth() is not the same as the result of wcwidth() of the system,
the column in the display shifts. 

The patch was corrected in consideration of the opinion of Tamotsu-san. 
http://www.emaillab.org/mutt/1.5.14/patch-1.5.14.tt.wcwidth.2
It uses wcwidth() of the system by default. Ambiguous cannot be handled. 
It comes to be able to treat Ambiguous by putting --enable-cjk-ambiguous-width
by the configure script. 

-- 
TAKIZAWA Takashi
http://www.emaillab.org/