* Sun Mar 4 2007 TAKIZAWA Takashi <[EMAIL PROTECTED]> > I want you to commit the patch concerning wcwidth. > http://www.emaillab.org/mutt/1.5.14/patch-1.5.14.tt.wcwidth.1 > > This patch updates wcwidth() to latest Markus Kuhn's one. > Because this wcwidth() supports CJK, the Japanese localization is > deleted from Mutt, and the CJK localization is added. > And it enables change of character-cell width of the East Asian > Ambiguous (A) class by using $cjk_width. > The detailed explanation of East Asian Ambiguous is written on the > following site. > http://www.unicode.org/unicode/reports/tr11/ > Because the characters for drawing of the tree is Ambiguous in UTF-8, > the relating change is done, too. > This patch has been used for one and a half years in the community of > mutt in Japan.
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? 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) > As the above-mentioned changes, mutt comes always to use not wcwidth() > of the systems but this wcwidth() of mutt. > This is because wcwidth() of the systems doesn't support Ambiguous. > If it wants to use wcwidth() of the systems, another patch that can > be changed in the configure script is prepared. > http://www.emaillab.org/mutt/1.5.14/patch-1.5.14.tt.wcwidth-alt.1 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? -int wcwidth(wchar_t wc) +int mutt_wcwidth(wchar_t wc) { +#ifdef HAVE_WC_FUNCS +# ifdef ENABLE_CJK_WIDTH + if (option (OPTCJKWIDTH) && + bisearch(wc, ambiguous, ...)) + return 2; +# endif + return wcwidth (wc); +#else /* !HAVE_WC_FUNCS */ ...your code... +#endif /+ HAVE_WC_FUNCS */ } -- tamo