jed-users mailing list

[2007 Date Index] [2007 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Non-ascii chars in UTF-8 mode not bindable


I did some more testing to track down the problem:

% utf-keybindings-test.sl: 
% 
% Copyright (c) 2006 Günter Milde
% Released under the terms of the GNU General Public License (ver. 2 or later)

% Jörg Sommer reported a problem with keybindings in UTF-8 mode:
% 
%   when you run jed or xjed in utf8???mode you can't bind functions to
%   non???ascii keys like °, ´ or ¬, because they are multibyte sequences
%   and they start all with the same charater. If you bind one, you loose all
%   other.


sw2buf("*utf8-test*");
fortran_mode();
vinsert("\nkeymap: %s\n", what_keymap);

insert("\nInitial state:\n");
vinsert(" Key '´' bound to %S %S\n", get_key_binding("´"));
vinsert(" Key '¬' bound to %S %S\n", get_key_binding("¬"));
vinsert(" Key '°' bound to %S %S\n", get_key_binding("°"));
vinsert(" Key '¼' bound to %S %S\n", get_key_binding("¼"));

vinsert("\nsetting '´' to bol() and '¬' to eol() in %s\n", what_keymap());
local_setkey("bol", "´");
local_setkey("eol", "¬");
vinsert(" Key '´' now bound to %S %S\n", get_key_binding("´"));
vinsert(" Key '¬' now bound to %S %S\n", get_key_binding("¬"));
vinsert(" Key '°' now bound to %S %S\n", get_key_binding("°"));
vinsert(" Key '¼' now bound to %S %S\n", get_key_binding("¼"));


no_mode();
vinsert("\nkeymap: %s\n", what_keymap);

vinsert("\nstate in %s keymap after bindings in Fortran map\n", what_keymap);
vinsert(" Key '´' bound to %S %S\n", get_key_binding("´"));
vinsert(" Key '°' bound to %S %S\n", get_key_binding("°"));
vinsert(" Key '¬' bound to %S %S\n", get_key_binding("¬"));
vinsert(" Key '¼' bound to %S %S\n", get_key_binding("¼"));

vinsert("\nsetting '´' to bol() and '¬' to eol()\n");
setkey("bol", "´");
setkey("eol", "¬");
vinsert(" Key '´' now bound to %S %S\n", get_key_binding("´"));
vinsert(" Key '¬' now bound to %S %S\n", get_key_binding("¬"));
vinsert(" Key '°' now bound to %S %S\n", get_key_binding("°"));
vinsert(" Key '¼' now bound to %S %S\n", get_key_binding("¼"));
   
vinsert("\nre-binding '°'\n");

% `self_insert_cmd' does not work but binding with the " string insert
% syntax" works fine:
setkey("self_insert_cmd", "°");
% setkey(" °", "°");
   
vinsert(" Key '´' now bound to %S %S\n", get_key_binding("´"));
vinsert(" Key '¬' now bound to %S %S\n", get_key_binding("¬"));
vinsert(" Key '°' now bound to %S %S\n", get_key_binding("°"));
vinsert(" Key '¼' now bound to %S %S\n", get_key_binding("¼"));

vinsert("\nTest the binding of the <degree key>,\n\n");
vinsert("\n should insert '°': ");
buffer_keystring("°");

Test result
-----------

1. Binding a key to a multi-bute UTF-8 character in the "Global" keymap

 * does not prevent other keybindings to multi-bute UTF-8 characters, but

 * does unset the fallback keybinding of single characters to
   "self_insert_cmd" (in this keymap only).
 
2. A binding to self_insert_cmd() does not work with multi-bute UTF-8
   characters.

   Binding with the " string insert syntax" (leading space) works fine.

Guenter

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2007 date index] [2007 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]