Commit 859ea4b8 authored by Gerd Moellmann's avatar Gerd Moellmann

(access_keymap): If a binding of the form (GENERIC-CHAR

. BINDING) exists, where GENERIC-CHAR is the generic character of
the charset of IDX, return BINDING, unless there exists or binding
for IDX itself.
parent 67e2eec4
2001-08-21 Gerd Moellmann <gerd@gnu.org>
* keymap.c (access_keymap): If a binding of the form (GENERIC-CHAR
. BINDING) exists, where GENERIC-CHAR is the generic character of
the charset of IDX, return BINDING unless there exists a binding
for IDX itself.
2001-08-16 Gerd Moellmann <gerd@gnu.org> 2001-08-16 Gerd Moellmann <gerd@gnu.org>
* xrdb.c (SYSV): Don't define on Solaris 2. * xrdb.c (SYSV): Don't define on Solaris 2.
......
...@@ -502,8 +502,11 @@ access_keymap (map, idx, t_ok, noinherit, autoload) ...@@ -502,8 +502,11 @@ access_keymap (map, idx, t_ok, noinherit, autoload)
{ {
Lisp_Object tail; Lisp_Object tail;
Lisp_Object t_binding; Lisp_Object t_binding;
Lisp_Object generic_binding;
t_binding = Qnil; t_binding = Qnil;
generic_binding = Qnil;
for (tail = XCDR (map); for (tail = XCDR (map);
(CONSP (tail) (CONSP (tail)
|| (tail = get_keymap (tail, 0, autoload), CONSP (tail))); || (tail = get_keymap (tail, 0, autoload), CONSP (tail)));
...@@ -521,7 +524,10 @@ access_keymap (map, idx, t_ok, noinherit, autoload) ...@@ -521,7 +524,10 @@ access_keymap (map, idx, t_ok, noinherit, autoload)
} }
else if (CONSP (binding)) else if (CONSP (binding))
{ {
if (EQ (XCAR (binding), idx)) Lisp_Object key = XCAR (binding);
int c1, c2, charset;
if (EQ (key, idx))
{ {
val = XCDR (binding); val = XCDR (binding);
if (noprefix && KEYMAPP (val)) if (noprefix && KEYMAPP (val))
...@@ -530,7 +536,21 @@ access_keymap (map, idx, t_ok, noinherit, autoload) ...@@ -530,7 +536,21 @@ access_keymap (map, idx, t_ok, noinherit, autoload)
fix_submap_inheritance (map, idx, val); fix_submap_inheritance (map, idx, val);
return get_keyelt (val, autoload); return get_keyelt (val, autoload);
} }
if (t_ok && EQ (XCAR (binding), Qt)) else if (INTEGERP (idx)
&& INTEGERP (key)
&& !SINGLE_BYTE_CHAR_P (XINT (idx))
&& !SINGLE_BYTE_CHAR_P (XINT (key))
&& CHAR_VALID_P (XINT (key), 1)
&& !CHAR_VALID_P (XINT (key), 0)
&& (CHAR_CHARSET (XINT (key))
== CHAR_CHARSET (XINT (idx))))
{
/* KEY is the generic character of the charset of IDX.
Use KEY's binding if there isn't a binding for IDX
itself. */
generic_binding = binding;
}
else if (t_ok && EQ (XCAR (binding), Qt))
t_binding = XCDR (binding); t_binding = XCDR (binding);
} }
else if (VECTORP (binding)) else if (VECTORP (binding))
...@@ -567,6 +587,9 @@ access_keymap (map, idx, t_ok, noinherit, autoload) ...@@ -567,6 +587,9 @@ access_keymap (map, idx, t_ok, noinherit, autoload)
QUIT; QUIT;
} }
if (!NILP (generic_binding))
return get_keyelt (generic_binding, autoload);
return get_keyelt (t_binding, autoload); return get_keyelt (t_binding, autoload);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment