2017-02-15 4:10 GMT+09:00 Dominique Pellé <[email protected]>:

> Kazunobu Kuriyama wrote:
>
> > 2017-02-14 5:43 GMT+09:00 Dominique Pellé <[email protected]>:
> >>
> >> Bram Moolenaar wrote:
> >>
> >> > Patch 8.0.0329
> >> > Problem:    Xfontset and guifontwide are not tested.
> >> > Solution:   Add tests. (Kazunobu Kuriyama)
> >> > Files:      src/testdir/test_gui.vim
> >>
> >> A test introduced by above patch fails when I configure vim-8.0.329
> with:
> >>
> >> $ configure --with-features=huge --enable-gui=motif
> >>
> >> ===
> >> Test results:
> >>
> >>
> >> From test_gui.vim:
> >> Found errors in Test_set_guifontset():
> >> Caught exception in Test_set_guifontset(): Vim(language):E197: Cannot
> >> set language to "ja_JP.eucJP" @ function
> >> RunTheTest[21]..Test_set_guifontset, line 13
> >> TEST FAILURE
> >> make: *** [report] Error 1
> >> ===
> >>
> >> With --enable-gui=gtk2, all tests pass.
> >>
> >> Line 13 in Test_set_guifontset is:
> >>
> >>    language ctype ja_JP.eucJP
> >>
> >> I don't have time to investigate now.  Maybe it happens because
> >> I don't have the Japanese locale installed.
> >
> >
> > Hi, Dominique
> >
> > Thank you for the report.
> >
> > As locale is libc proper, I never imaged that could happen.
> >
> > So, I need to begin with things to ask you.  Since you;re looking busy
> now,
> > I'd be happy if you could reply when you find it convenient.
> >
> > Could you do '/usr/share/locale | grep ^ja' and check if there's a
> directory
> > named 'ja_JP.eucJP/'?
> >
> > In case there's no such a directory, could you do 'grep ^ja
> > /usr/share/locale/locale.alias'?  If you find any of Japanese locales
> and
> > their aliases there, and if you have the directories corresponding to
> them,
> > we might change test_gui accordingly.
> >
> >> Or maybe it's a limitation
> >> of the Motif GUI, since all tests pass when using the gtk2 GUI.
> >
> >
> > The GTK GUIs don't support 'guifontset' and thus the test is skipped.
> >>
> >>
> >> Regards
> >> Dominique
> >
> >
> > Regards,
> > Kazunobu
>
>
> Hi Kazunobu
>
> I saw that you already sent another patch, so I'm not sure
> it matters a lot if I respond to the above questions any more.
>
> I did this:
>
> $ sudo apt-get install language-pack-ja
> I now see ja_JP.UTF-8 in the output of locale -a.
> But the test still fails in the same way.
>
> Output of "locale -a":
>
> $ locale -a
> br_FR.utf8
> C
> C.UTF-8
> en_AG
> en_AG.utf8
> en_AU.utf8
> en_BW.utf8
> en_CA.utf8
> en_DK.utf8
> en_GB.utf8
> en_HK.utf8
> en_IE.utf8
> en_IN
> en_IN.utf8
> en_NG
> en_NG.utf8
> en_NZ.utf8
> en_PH.utf8
> en_SG.utf8
> en_US.utf8
> en_ZA.utf8
> en_ZM
> en_ZM.utf8
> en_ZW.utf8
> eo_US.utf8
> eo.utf8
> fr_BE.utf8
> fr_CA.utf8
> fr_CH.utf8
> fr_FR.utf8
> fr_LU.utf8
> it_CH.utf8
> it_IT.utf8
> ja_JP.utf8
> nl_AW
> nl_AW.utf8
> nl_BE.utf8
> nl_NL.utf8
> POSIX
>
> Output that you requested:
>
> $ ls /usr/share/locale | grep ^ja
> ja
>
> $ grep ^ja /usr/share/locale/locale.alias
> japanese    ja_JP.eucJP
> japanese.euc    ja_JP.eucJP
> ja_JP        ja_JP.eucJP
> ja_JP.ujis    ja_JP.eucJP
> japanese.sjis    ja_JP.SJIS
>
>
> Ah, I just see that all tests pass if I do this:
>
> $ git diff
> diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
> index 49bc026..9e5408a 100644
> --- a/src/testdir/test_gui.vim
> +++ b/src/testdir/test_gui.vim
> @@ -144,7 +144,7 @@ func Test_set_guifontset()
>      " job done.  To make the test meaningful for a wide variety of hosts,
> we
>      " confine ourselves to the following locale for which X11
> historically has
>      " the fonts to use with.
> -    language ctype ja_JP.eucJP
> +    language ctype ja_JP.UTF-8
>
>      " Since XCreateFontSet(3) is very sensitive to locale, fonts must be
>      " chosen meticulously.
>
> Hi Dominique,

Thank you for the very interesting result.  I got it.

It looks that the xubuntu is made specialized in UTF-8 locales, and that
fonts are chosen accordingly to support them well.  It adopts a modern
locale handling, although there still remain some remnants of the
pre-unicode era in locale.alias.

Meanwhile, as for my OS X, there're still many pre-unicode era encodings in
/usr/share/locale, and XQuartz, an X11 implementation for OS X, is a bare
minimum X11; there's no GTK+, Qt, Gnome nor KDE; you have only twm and
xterm there :)  Although it actually supports UTF-8 locales and encodings,
there're many fonts in /opt/X11/lib/X11/fonts/misc to support locales of
old encodings.

In addition to the difference in installed fonts between the modern and the
traditional systems, XCreateFontSet(), which creates a font list out of a
given XLFD list and the current locale, is very sensitive to font paths as
well as the current locale when the XLFDs in the list have wild cards.
Different font paths can yield different font lists for the same XLFD list.

All those factors explain why I found a difficulty in writing a test with a
UTF-8 locale-encoding while you succeeded in that (quite easily, without
any additional font installation nor tweaking font paths many times to make
the test success, I guess).

In short, it's hard to write an xfontset test meaningful for every
environment. :)

But now, thanks to your report, which is very helpful to me, I think I've
got a better sense of how to revise the test.  I'll soon send you a patch
which gives a useful test to both modern and traditional locale-encoding
systems.

>
> Regards
> Dominique
>
> PS: I'm using xubuntu-14.04.5 x86_64.
>

Regards,
Kazunobu

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui