[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/keymap.c [emacs-unicode-2]
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] Changes to emacs/src/keymap.c [emacs-unicode-2] |
Date: |
Sun, 23 Nov 2003 21:46:11 -0500 |
Index: emacs/src/keymap.c
diff -c emacs/src/keymap.c:1.282.4.4 emacs/src/keymap.c:1.282.4.5
*** emacs/src/keymap.c:1.282.4.4 Sat Nov 22 06:04:01 2003
--- emacs/src/keymap.c Sun Nov 23 21:46:11 2003
***************
*** 870,875 ****
--- 870,888 ----
ASET (elt, XFASTINT (idx), def);
return def;
}
+ else if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+ {
+ int from = XFASTINT (XCAR (idx));
+ int to = XFASTINT (XCDR (idx));
+
+ if (to >= ASIZE (elt))
+ to = ASIZE (elt) - 1;
+ for (; from <= to; from++)
+ ASET (elt, from, def);
+ if (to == XFASTINT (XCDR (idx)))
+ /* We have defined all keys in IDX. */
+ return def;
+ }
insertion_point = tail;
}
else if (CHAR_TABLE_P (elt))
***************
*** 900,905 ****
--- 913,931 ----
XSETCDR (elt, def);
return def;
}
+ else if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+ {
+ int from = XFASTINT (XCAR (idx));
+ int to = XFASTINT (XCDR (idx));
+
+ if (from <= XFASTINT (XCAR (elt))
+ && to >= XFASTINT (XCAR (elt)))
+ {
+ XSETCDR (elt, def);
+ if (from == to)
+ return def;
+ }
+ }
}
else if (EQ (elt, Qkeymap))
/* If we find a 'keymap' symbol in the spine of KEYMAP,
***************
*** 914,921 ****
keymap_end:
/* We have scanned the entire keymap, and not found a binding for
IDX. Let's add one. */
! XSETCDR (insertion_point,
! Fcons (Fcons (idx, def), XCDR (insertion_point)));
}
return def;
--- 940,960 ----
keymap_end:
/* We have scanned the entire keymap, and not found a binding for
IDX. Let's add one. */
! {
! Lisp_Object elt;
!
! if (CONSP (idx) && CHARACTERP (XCAR (idx)))
! {
! /* IDX specifies a range of characters, and not all of them
! were handled yet, which means this keymap doesn't have a
! char-table. So, we insert a char-table now. */
! elt = Fmake_char_table (Qkeymap, Qnil);
! Fset_char_table_range (elt, idx, NILP (def) ? Qt : def);
! }
! else
! elt = Fcons (idx, def);
! XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point)));
! }
}
return def;