[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rebinding international characters

From: Kenichi Handa
Subject: Re: Rebinding international characters
Date: Tue, 17 Aug 2004 16:14:13 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, Richard Stallman <address@hidden> writes:

> The node Non-ASCII Rebinding ends with this advice:
>     If you bind 8-bit characters like this in your init file, you may find it
>     convenient to specify that it is unibyte.  @xref{Enabling Multibyte}.

> Is that still correct?

No.  I tested what is given to Emacs by typing a non-ASCII
key `ñ' in various situations.   The result is quite

(1) (read-char)
(2) (read-key-sequence "")
(3) just type it

(A) LANG=C --multibyte -nw  (keyboard-coding-system == nil)
(A-1) 134217841 (== ?\M-q)
(A-2) "\361"
(A-3) invoke fill-paragraph

(B) LANG=C --multibyte  (keyboard-coding-system == nil)
(B-1) 2289      <- handle_one_xevent converts keysym by x-keysym-table
(B-2) [2289]
(B-3) Insert multibyte ñ (== 2289).

(C) LANG=de_DE --multibyte -nw  (keyboard-coding-system == iso-latin-1)
(C-1) 241      <- set-keyboard-coding-system sets input mode
                  to accept 8-bit as is
(C-2) [2289]   <- by key-translation-map
(C-3) Insert multibyte ñ (== 2289).

(D) LANG=de_DE --multibyte  (keyboard-coding-system == nil)
(D-1) 2289
(D-2) [2289]
(D-3) Insert multibyte ñ (== 2289).

(E) LANG=C --unibyte -nw  (keyboard-coding-system == nil)
(E-1) 134217841 (== ?\M-q)
(E-2) "\361"
(E-3) invoke fill-paragraph

(F) LANG=C --unibyte  (keyboard-coding-system == nil)
(F-1) 2289
(F-2) [2289]
(F-3) Insert unibyte ñ (== 241)

(G) LANG=de_DE --unibyte -nw  (keyboard-coding-system == iso-latin-1)
(G-1) 241
(G-2) [2289]
(G-3) Insert unibyte ñ (== 241).

(H) LANG=de_DE --unibyte  (keyboard-coding-system == nil)
(H-1) 2289
(H-2) [2289]
(H-3) Insert unibyte ñ (== 241).

I think (C-1), (F-1), (F-2), (G-2), (H-1), (H-2) are not
good.  (C-1) should be 2289, (F-1) (H-1) should be 241,
(F-2) (G-2) (H-2) should be [241].

To fix (C-1), we must handle keyboard-coding-system in
read_char (perhaps after handling keyboard-translation-table
and before handling an input method).

To fix (F-1) (F-2) (H-1) (H-2), we should call
multibyte_char_to_unibyte in handle_one_xevent.  But when?
Should we check enable-multibyte-character of the current
buffer?  Or default-enable-multibyte-character?

To fix (G-2), we should simply don't setup

After those fixes, we can consider what to write in info for
non-ASCII bindings.

Ken'ichi HANDA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]