.FN!set-language-environment.FN" should set .FN!language-unicode-precedence-list.FN"

Mike FABIAN mfabian at suse.de
Wed Aug 1 11:57:24 EDT 2007


Aidan Kehoe <kehoea at parhasard.net> さんは書きました:

>  Ar an t-aonú lá is triochad de mí Iúil, scríobh Mike FABIAN: 
>
>  > So I think language-unicode-precedence-list should be set depending on
>  > the Language environment, otherwise one may get fonts which
>  > are not nice for the current language.
>
> Agreed. 
>
> I also need to add locale information to many of the language environments;
> I had thought I had done so, but evidently not.

I found that information about the charsets is already there in the
language environments, in the property 'charset in
‘language-info-alist’. And it seems to be used in
‘finish-set-language-environment’, which contains:

  ;; Fit the charsets preferences in unicode conversions for the
  ;; language environment.
  (set-language-unicode-precedence-list
   (get-language-info language-name 'charset))

So I tried the attached patch
‘set-language-unicode-precedence-list.patch’.

It didn't work because I also have the patch
bugzilla-294746-set-language-unicode-precedence-list-at-startup.patch
according to your earlier suggestion to get ‘”’ U+201D (RIGHT DOUBLE
QUOTATION MARK) treated as single width consistently.

This call to ‘set-language-unicode-precedence-list’ apparently comes
after the initial setup of the language-environment and therefore
overrides the charset list from the language-environment again.

I worked around that by adding 

    (set-language-unicode-precedence-list
     (get-language-info current-language-environment 'charset))

to site-start.el (I have removed my previous code from site-start.el
which did set the language-environment and the
language-unicode-precedence-list because it is better if less workarounds
are needed in site-start.el and XEmacs does more things right by default
already).

Now I can switch between the language environments “Japanese (UTF-8)”
and “Chinese-BIG5 (UTF-8)” interactively and get different fonts
preferred.

My patch set-language-unicode-precedence-list.patch adds more charsets
to the language environments, for example I added the latin-* charsets
to the top of the list also for the Japanese language environments. I
guess this is better because one usually wants to see glyphs from these
charsets from European fonts because these glyphs are usually nicer in
European than in Asian fonts.

By the way, adding the charsets ‘latin-iso8859-13’ and
‘latin-iso8859-16’ to the charset lists in the language-environments
gives an error during startup because these are apparently not yet
available when ‘finish-set-language-environment’ is called. I don’t know
whether this is good/bad/doesn’t matter.

-- 
Mike FABIAN   <mfabian at suse.de>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。
I � Unicode

-------------- next part --------------
A non-text attachment was scrubbed...
Name: set-language-unicode-precedence-list.patch
Type: text/x-patch
Size: 2883 bytes
Desc: not available
Url : http://lists.xemacs.org/pipermail/xemacs-beta/attachments/20070801/7e0eb879/set-language-unicode-precedence-list.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bugzilla-294746-set-language-unicode-precedence-list-at-startup.patch
Type: text/x-patch
Size: 1275 bytes
Desc: not available
Url : http://lists.xemacs.org/pipermail/xemacs-beta/attachments/20070801/7e0eb879/bugzilla-294746-set-language-unicode-precedence-list-at-startup.bin


More information about the XEmacs-Beta mailing list