>>>> "Hrvoje" == Hrvoje Niksic
<hniksic(a)arsdigita.com> writes:
>>>> "SJT" == Stephen J Turnbull <turnbull(a)sk.tsukuba.ac.jp>
writes:
Hrvoje> Does this work:
Hrvoje> (global-set-key 'Cyrillic_HardSIGN 'self-insert-command)
Hrvoje> (put 'Cyrillic_HardSIGN 'ascii-value ?\xff)
Hrvoje> If it works, it should also work with isearch and friends.
No, it doesn't. 21.1 says
last typed character has no ASCII equivalent: #<keypress-event Cyrillic_HARDSIGN>
21.4 ignores 'ascii-value and continues to use hardcoded 8859-5
chars.
> (set-xkb-cyrillic-charset "koi8-r") ;; also
"iso8859-5" (default),
> ;; "windows-1251" and "cp866"
Hrvoje> The name might be misleading because:
Hrvoje> * AFAIK x_keysym_to_character is not xkb-specific.
I always thought that x11/keysymdef.h is defined only for xkb (IMHO,
xmodmap is able only to specify numeric character codes and does not
know about Cyrillic_XXX et al).
Hrvoje> * It uses the term `charset' which *looks* like it refers to
Hrvoje> Mule, although the function has in fact nothing to do with
Hrvoje> Mule.
Hrvoje> * Other charsets might require similar hacks.
Hrvoje> How about:
Hrvoje> (x-set-keysym-translation 'cyrillic 'koi8-r)
Hrvoje> (x-set-keysym-translation 'latin-2 'windows-1250) ...
I like style of this one, see below.
SJT> Much better IMO, but as I understand it, conceptually there is
SJT> only one keysym translation table. So how about the interface
SJT> (x-set-keysym-translation 'Cyrillic_HARDSIGN ?\xff)
SJT> (x-set-keysym-translation-subset 'cyrillic 'koi8-r)
SJT> (setq koi8-r (x-get-keysym-translation-subset 'cyrillic))
SJT> etc?
In this case first clause should be (it should modify
cyrillic_koi8_r[] that is stored somewhere in some hashtable and used
by x_keysym_to_character():
(x-set-keysym-translation 'koi8-r 'Cyrillic_HARDSIGN ?\xff)
(x-set-keysym-translation 'iso8859-5 'Cyrillic_HARDSIGN ?\xca)
(x-set-keysym-translation 'windows-1251 'Cyrillic_HARDSIGN ?\xda)
(I just wanted to hardcode those tables into src/event-Xt.c, but do
not object to implement modifying those tables). I think they should
be predefined in stock XEmacs w/o any Lisp definitions (in style of
cyrillic[] array that currently exists).
Next we choose
(x-set-keysym-translation-subset 'cyrillic 'koi8-r)
I do not understand what you're trying to do with
(setq koi8-r (x-get-keysym-translation-subset 'cyrillic))
I slightly feel like opening Pandora's box. :)
--alexm