Hi,

> Actually, it's possible, though not pretty. Quoting Ivan
> Pascal from the gswitchit-kxkb list
> 
>   > Now the next question: what about the Compose file, can I
>   > put that in my home dir somehow? :-)
> 
>   Xlib always searches that file as <xlocaledir>/<locale name>/Compose .
>   But you can change <xlocaledir> using environment variable XLOCALEDIR
>   (it doesn't work for suid programs).

Although it is an offtopic in this thread but after the discussion about Compose
files in Xlib I forgot to announce when those changes were commited.
Therefore I want to do it now.

Since 4.3.99.12 Xlib has more flexible Compose file processing.
It searches the file in the following order:
1.  If an environment variable XCOMPOSEFILE exists its value is the name of
the compose file.
2.  Otherwise the library searches in the users home directory a file named
.XCompose .  If the file exists it is used as the compose file
3.  And if both previous attempts fail Xlib searches this file in old manner
as <xlocaledir>/<locale name>/Compose .

In your compose file you can use an 'include' instruction.  For example

include "/usr/X11R6/lib/X11/locale/C/Compose"

There are two substitutions that can be used in the file name of the include
instruction:
 %H - means the users home directory (HOME variable value)
 %L - means the name of 'locale depended Compose file',
      i.e. <xlocaledir>/<locale name>/Compose
For example you can include in your compose file a 'common' Compose file as

include "%L"

and then rewrite only a few rules you need.  Of coures if you write into the
file a rule which left part is the same as in some rule from he included file,
the previous rule will be thrown out and replaced with the latest rule.

And finallly,  you don't need to specify in the right part of a rule a locale
encoded string with a keysym name.  If the string is ommited Xlib figuresb it
out from the keysym according to the current locale.
I.e. if a rule looks like

<dead_grave> <A> : "\300" Agrave

the result of the composing always is the letter with "\300" code.
But if your rule is

<dead_grave> <A> : Agrave

it means the result depends on the curreent locale ("\300" when a locale
is one of *.iso8859-1 family but "ц─" in *.UTF-8 locale).

-- 
 Ivan U. Pascal         |   e-mail: [EMAIL PROTECTED]
   Administrator of     |   Tomsk State University
     University Network |       Tomsk, Russia
_______________________________________________
I18n mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/i18n

Reply via email to