25 |
#include "lisp.h" |
#include "lisp.h" |
26 |
#include "commands.h" |
#include "commands.h" |
27 |
#include "buffer.h" |
#include "buffer.h" |
28 |
|
#include "character.h" |
29 |
#include "charset.h" |
#include "charset.h" |
30 |
#include "keyboard.h" |
#include "keyboard.h" |
31 |
#include "termhooks.h" |
#include "termhooks.h" |
414 |
Lisp_Object indices[3]; |
Lisp_Object indices[3]; |
415 |
|
|
416 |
map_char_table (fix_submap_inheritance, Qnil, |
map_char_table (fix_submap_inheritance, Qnil, |
417 |
XCAR (list), XCAR (list), |
XCAR (list), keymap); |
|
keymap, 0, indices); |
|
418 |
} |
} |
419 |
} |
} |
420 |
|
|
550 |
|
|
551 |
GCPRO4 (map, tail, idx, t_binding); |
GCPRO4 (map, tail, idx, t_binding); |
552 |
|
|
553 |
/* If `t_ok' is 2, both `t' and generic-char bindings are accepted. |
/* If `t_ok' is 2, both `t' is accepted. */ |
|
If it is 1, only generic-char bindings are accepted. |
|
|
Otherwise, neither are. */ |
|
554 |
t_ok = t_ok ? 2 : 0; |
t_ok = t_ok ? 2 : 0; |
555 |
|
|
556 |
for (tail = XCDR (map); |
for (tail = XCDR (map); |
574 |
|
|
575 |
if (EQ (key, idx)) |
if (EQ (key, idx)) |
576 |
val = XCDR (binding); |
val = XCDR (binding); |
|
else if (t_ok |
|
|
&& INTEGERP (idx) |
|
|
&& (XINT (idx) & CHAR_MODIFIER_MASK) == 0 |
|
|
&& INTEGERP (key) |
|
|
&& (XINT (key) & CHAR_MODIFIER_MASK) == 0 |
|
|
&& !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. */ |
|
|
t_binding = XCDR (binding); |
|
|
t_ok = 0; |
|
|
} |
|
577 |
else if (t_ok > 1 && EQ (key, Qt)) |
else if (t_ok > 1 && EQ (key, Qt)) |
578 |
{ |
{ |
579 |
t_binding = XCDR (binding); |
t_binding = XCDR (binding); |
667 |
tail = XCDR (tail)) |
tail = XCDR (tail)) |
668 |
{ |
{ |
669 |
Lisp_Object binding = XCAR (tail); |
Lisp_Object binding = XCAR (tail); |
670 |
|
|
671 |
if (CONSP (binding)) |
if (CONSP (binding)) |
672 |
map_keymap_item (fun, args, XCAR (binding), XCDR (binding), data); |
map_keymap_item (fun, args, XCAR (binding), XCDR (binding), data); |
673 |
else if (VECTORP (binding)) |
else if (VECTORP (binding)) |
686 |
else if (CHAR_TABLE_P (binding)) |
else if (CHAR_TABLE_P (binding)) |
687 |
{ |
{ |
688 |
Lisp_Object indices[3]; |
Lisp_Object indices[3]; |
689 |
map_char_table (map_keymap_char_table_item, Qnil, binding, binding, |
map_char_table (map_keymap_char_table_item, Qnil, binding, |
690 |
Fcons (make_save_value (fun, 0), |
Fcons (make_save_value (fun, 0), |
691 |
Fcons (make_save_value (data, 0), |
Fcons (make_save_value (data, 0), |
692 |
args)), |
args))); |
|
0, indices); |
|
693 |
} |
} |
694 |
} |
} |
695 |
UNGCPRO; |
UNGCPRO; |
885 |
NILP (def) ? Qt : def); |
NILP (def) ? Qt : def); |
886 |
return def; |
return def; |
887 |
} |
} |
888 |
|
else if (CONSP (idx) && CHARACTERP (XCAR (idx))) |
889 |
|
{ |
890 |
|
Fset_char_table_range (elt, idx, NILP (def) ? Qt : def); |
891 |
|
return def; |
892 |
|
} |
893 |
insertion_point = tail; |
insertion_point = tail; |
894 |
} |
} |
895 |
else if (CONSP (elt)) |
else if (CONSP (elt)) |
1000 |
copy_keymap_1 (chartable, idx, elt) |
copy_keymap_1 (chartable, idx, elt) |
1001 |
Lisp_Object chartable, idx, elt; |
Lisp_Object chartable, idx, elt; |
1002 |
{ |
{ |
1003 |
Faset (chartable, idx, copy_keymap_item (elt)); |
Fset_char_table_range (chartable, idx, copy_keymap_item (elt)); |
1004 |
} |
} |
1005 |
|
|
1006 |
DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0, |
DEFUN ("copy-keymap", Fcopy_keymap, Scopy_keymap, 1, 1, 0, |
1025 |
{ |
{ |
1026 |
Lisp_Object indices[3]; |
Lisp_Object indices[3]; |
1027 |
elt = Fcopy_sequence (elt); |
elt = Fcopy_sequence (elt); |
1028 |
map_char_table (copy_keymap_1, Qnil, elt, elt, elt, 0, indices); |
map_char_table (copy_keymap_1, Qnil, elt, elt); |
1029 |
} |
} |
1030 |
else if (VECTORP (elt)) |
else if (VECTORP (elt)) |
1031 |
{ |
{ |
1106 |
{ |
{ |
1107 |
c = Faref (key, make_number (idx)); |
c = Faref (key, make_number (idx)); |
1108 |
|
|
1109 |
if (CONSP (c) && lucid_event_type_list_p (c)) |
if (CONSP (c)) |
1110 |
c = Fevent_convert_list (c); |
{ |
1111 |
|
/* C may be a cons (FROM . TO) specifying a range of |
1112 |
|
characters. */ |
1113 |
|
if (CHARACTERP (XCAR (c))) |
1114 |
|
CHECK_CHARACTER_CDR (c); |
1115 |
|
else if (lucid_event_type_list_p (c)) |
1116 |
|
c = Fevent_convert_list (c); |
1117 |
|
} |
1118 |
|
|
1119 |
if (SYMBOLP (c)) |
if (SYMBOLP (c)) |
1120 |
silly_event_symbol_error (c); |
silly_event_symbol_error (c); |
1135 |
idx++; |
idx++; |
1136 |
} |
} |
1137 |
|
|
1138 |
if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c)) |
if (!INTEGERP (c) && !SYMBOLP (c) |
1139 |
|
&& (!CONSP (c) |
1140 |
|
/* If C is a range, it must be a leaf. */ |
1141 |
|
|| (INTEGERP (XCAR (c)) && idx != length))) |
1142 |
error ("Key sequence contains invalid event"); |
error ("Key sequence contains invalid event"); |
1143 |
|
|
1144 |
if (idx == length) |
if (idx == length) |
1786 |
int meta_bit = meta_modifier; |
int meta_bit = meta_modifier; |
1787 |
Lisp_Object last = make_number (XINT (Flength (thisseq)) - 1); |
Lisp_Object last = make_number (XINT (Flength (thisseq)) - 1); |
1788 |
tem = Fcopy_sequence (thisseq); |
tem = Fcopy_sequence (thisseq); |
1789 |
|
|
1790 |
Faset (tem, last, make_number (XINT (key) | meta_bit)); |
Faset (tem, last, make_number (XINT (key) | meta_bit)); |
1791 |
|
|
1792 |
/* This new sequence is the same length as |
/* This new sequence is the same length as |
1793 |
thisseq, so stick it in the list right |
thisseq, so stick it in the list right |
1794 |
after this one. */ |
after this one. */ |
1909 |
{ |
{ |
1910 |
Lisp_Object indices[3]; |
Lisp_Object indices[3]; |
1911 |
|
|
1912 |
map_char_table (accessible_keymaps_char_table, Qnil, elt, |
map_char_table (accessible_keymaps_char_table, Qnil, |
1913 |
elt, Fcons (Fcons (maps, make_number (is_metized)), |
elt, Fcons (Fcons (maps, make_number (is_metized)), |
1914 |
Fcons (tail, thisseq)), |
Fcons (tail, thisseq))); |
|
0, indices); |
|
1915 |
} |
} |
1916 |
else if (VECTORP (elt)) |
else if (VECTORP (elt)) |
1917 |
{ |
{ |
2108 |
{ |
{ |
2109 |
*p++ = c; |
*p++ = c; |
2110 |
} |
} |
2111 |
|
else if (CHARACTERP (make_number (c))) |
2112 |
|
{ |
2113 |
|
if (NILP (current_buffer->enable_multibyte_characters) |
2114 |
|
&& ! force_multibyte) |
2115 |
|
*p++ = multibyte_char_to_unibyte (c, Qnil); |
2116 |
|
else |
2117 |
|
p += CHAR_STRING (c, (unsigned char *) p); |
2118 |
|
} |
2119 |
else |
else |
2120 |
{ |
{ |
2121 |
int valid_p = SINGLE_BYTE_CHAR_P (c) || char_valid_p (c, 0); |
int bit_offset; |
2122 |
|
*p++ = '\\'; |
2123 |
if (force_multibyte && valid_p) |
/* The biggest character code uses 22 bits. */ |
2124 |
|
for (bit_offset = 21; bit_offset >= 0; bit_offset -= 3) |
2125 |
{ |
{ |
2126 |
if (SINGLE_BYTE_CHAR_P (c)) |
if (c >= (1 << bit_offset)) |
2127 |
c = unibyte_char_to_multibyte (c); |
*p++ = ((c & (7 << bit_offset)) >> bit_offset) + '0'; |
|
p += CHAR_STRING (c, p); |
|
|
} |
|
|
else if (NILP (current_buffer->enable_multibyte_characters) |
|
|
|| valid_p) |
|
|
{ |
|
|
int bit_offset; |
|
|
*p++ = '\\'; |
|
|
/* The biggest character code uses 19 bits. */ |
|
|
for (bit_offset = 18; bit_offset >= 0; bit_offset -= 3) |
|
|
{ |
|
|
if (c >= (1 << bit_offset)) |
|
|
*p++ = ((c & (7 << bit_offset)) >> bit_offset) + '0'; |
|
|
} |
|
2128 |
} |
} |
|
else |
|
|
p += CHAR_STRING (c, p); |
|
2129 |
} |
} |
2130 |
|
|
2131 |
return p; |
return p; |
2149 |
|
|
2150 |
if (INTEGERP (key)) /* Normal character */ |
if (INTEGERP (key)) /* Normal character */ |
2151 |
{ |
{ |
2152 |
unsigned int charset, c1, c2; |
char tem[KEY_DESCRIPTION_SIZE]; |
|
int without_bits = XINT (key) & ~((-1) << CHARACTERBITS); |
|
|
|
|
|
if (SINGLE_BYTE_CHAR_P (without_bits)) |
|
|
charset = 0; |
|
|
else |
|
|
SPLIT_CHAR (without_bits, charset, c1, c2); |
|
2153 |
|
|
2154 |
if (charset |
*push_key_description (XUINT (key), tem, 1) = 0; |
2155 |
&& CHARSET_DEFINED_P (charset) |
return build_string (tem); |
|
&& ((c1 >= 0 && c1 < 32) |
|
|
|| (c2 >= 0 && c2 < 32))) |
|
|
{ |
|
|
/* Handle a generic character. */ |
|
|
Lisp_Object name; |
|
|
name = CHARSET_TABLE_INFO (charset, CHARSET_LONG_NAME_IDX); |
|
|
CHECK_STRING (name); |
|
|
return concat2 (build_string ("Character set "), name); |
|
|
} |
|
|
else |
|
|
{ |
|
|
char tem[KEY_DESCRIPTION_SIZE], *end; |
|
|
int nbytes, nchars; |
|
|
Lisp_Object string; |
|
|
|
|
|
end = push_key_description (XUINT (key), tem, 1); |
|
|
nbytes = end - tem; |
|
|
nchars = multibyte_chars_in_text (tem, nbytes); |
|
|
if (nchars == nbytes) |
|
|
{ |
|
|
*end = '\0'; |
|
|
string = build_string (tem); |
|
|
} |
|
|
else |
|
|
string = make_multibyte_string (tem, nchars, nbytes); |
|
|
return string; |
|
|
} |
|
2156 |
} |
} |
2157 |
else if (SYMBOLP (key)) /* Function key or event-symbol */ |
else if (SYMBOLP (key)) /* Function key or event-symbol */ |
2158 |
{ |
{ |
2214 |
CHECK_NUMBER (character); |
CHECK_NUMBER (character); |
2215 |
|
|
2216 |
c = XINT (character); |
c = XINT (character); |
2217 |
if (!SINGLE_BYTE_CHAR_P (c)) |
if (!ASCII_CHAR_P (c)) |
2218 |
{ |
{ |
2219 |
int len = CHAR_STRING (c, str); |
int len = CHAR_STRING (c, str); |
2220 |
|
|
2386 |
Fcons (Fcons (this, last), |
Fcons (Fcons (this, last), |
2387 |
Fcons (make_number (nomenus), |
Fcons (make_number (nomenus), |
2388 |
make_number (last_is_meta)))); |
make_number (last_is_meta)))); |
2389 |
map_char_table (where_is_internal_2, Qnil, elt, elt, args, |
map_char_table (where_is_internal_2, Qnil, elt, args); |
|
0, indices); |
|
2390 |
sequences = XCDR (XCAR (args)); |
sequences = XCDR (XCAR (args)); |
2391 |
} |
} |
2392 |
else if (CONSP (elt)) |
else if (CONSP (elt)) |
3199 |
If the definition in effect in the whole map does not match |
If the definition in effect in the whole map does not match |
3200 |
the one in this vector, we ignore this one. |
the one in this vector, we ignore this one. |
3201 |
|
|
3202 |
When describing a sub-char-table, INDICES is a list of |
ARGS is simply passed as the second argument to ELT_DESCRIBER. |
|
indices at higher levels in this char-table, |
|
|
and CHAR_TABLE_DEPTH says how many levels down we have gone. |
|
3203 |
|
|
3204 |
ARGS is simply passed as the second argument to ELT_DESCRIBER. */ |
INDICES and CHAR_TABLE_DEPTH are ignored. They will be removed in |
3205 |
|
the near future. */ |
3206 |
|
|
3207 |
void |
void |
3208 |
describe_vector (vector, elt_prefix, args, elt_describer, |
describe_vector (vector, elt_prefix, args, elt_describer, |
3219 |
{ |
{ |
3220 |
Lisp_Object definition; |
Lisp_Object definition; |
3221 |
Lisp_Object tem2; |
Lisp_Object tem2; |
3222 |
register int i; |
int i; |
3223 |
Lisp_Object suppress; |
Lisp_Object suppress; |
3224 |
Lisp_Object kludge; |
Lisp_Object kludge; |
|
int first = 1; |
|
3225 |
struct gcpro gcpro1, gcpro2, gcpro3; |
struct gcpro gcpro1, gcpro2, gcpro3; |
3226 |
/* Range of elements to be handled. */ |
/* Range of elements to be handled. */ |
3227 |
int from, to; |
int from, to; |
3228 |
/* A flag to tell if a leaf in this level of char-table is not a |
Lisp_Object character; |
|
generic character (i.e. a complete multibyte character). */ |
|
|
int complete_char; |
|
|
int character; |
|
3229 |
int starting_i; |
int starting_i; |
3230 |
|
int first = 1; |
3231 |
|
|
3232 |
suppress = Qnil; |
suppress = Qnil; |
3233 |
|
|
|
if (indices == 0) |
|
|
indices = (int *) alloca (3 * sizeof (int)); |
|
|
|
|
3234 |
definition = Qnil; |
definition = Qnil; |
3235 |
|
|
3236 |
/* This vector gets used to present single keys to Flookup_key. Since |
/* This vector gets used to present single keys to Flookup_key. Since |
3242 |
if (partial) |
if (partial) |
3243 |
suppress = intern ("suppress-keymap"); |
suppress = intern ("suppress-keymap"); |
3244 |
|
|
3245 |
if (CHAR_TABLE_P (vector)) |
from = 0; |
3246 |
{ |
to = CHAR_TABLE_P (vector) ? MAX_CHAR + 1 : XVECTOR (vector)->size; |
|
if (char_table_depth == 0) |
|
|
{ |
|
|
/* VECTOR is a top level char-table. */ |
|
|
complete_char = 1; |
|
|
from = 0; |
|
|
to = CHAR_TABLE_ORDINARY_SLOTS; |
|
|
} |
|
|
else |
|
|
{ |
|
|
/* VECTOR is a sub char-table. */ |
|
|
if (char_table_depth >= 3) |
|
|
/* A char-table is never that deep. */ |
|
|
error ("Too deep char table"); |
|
|
|
|
|
complete_char |
|
|
= (CHARSET_VALID_P (indices[0]) |
|
|
&& ((CHARSET_DIMENSION (indices[0]) == 1 |
|
|
&& char_table_depth == 1) |
|
|
|| char_table_depth == 2)); |
|
|
|
|
|
/* Meaningful elements are from 32th to 127th. */ |
|
|
from = 32; |
|
|
to = SUB_CHAR_TABLE_ORDINARY_SLOTS; |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
/* This does the right thing for ordinary vectors. */ |
|
|
|
|
|
complete_char = 1; |
|
|
from = 0; |
|
|
to = XVECTOR (vector)->size; |
|
|
} |
|
3247 |
|
|
3248 |
for (i = from; i < to; i++) |
for (i = from; i < to; i++) |
3249 |
{ |
{ |
3250 |
QUIT; |
int range_beg, range_end; |
3251 |
|
Lisp_Object val; |
3252 |
|
|
3253 |
if (CHAR_TABLE_P (vector)) |
QUIT; |
|
{ |
|
|
if (char_table_depth == 0 && i >= CHAR_TABLE_SINGLE_BYTE_SLOTS) |
|
|
complete_char = 0; |
|
3254 |
|
|
3255 |
if (i >= CHAR_TABLE_SINGLE_BYTE_SLOTS |
starting_i = i; |
|
&& !CHARSET_DEFINED_P (i - 128)) |
|
|
continue; |
|
3256 |
|
|
3257 |
definition |
if (CHAR_TABLE_P (vector)) |
3258 |
= get_keyelt (XCHAR_TABLE (vector)->contents[i], 0); |
val = char_table_ref_and_range (vector, i, &range_beg, &i); |
|
} |
|
3259 |
else |
else |
3260 |
definition = get_keyelt (AREF (vector, i), 0); |
val = AREF (vector, i); |
3261 |
|
definition = get_keyelt (val, 0); |
3262 |
|
|
3263 |
if (NILP (definition)) continue; |
if (NILP (definition)) continue; |
3264 |
|
|
3272 |
if (!NILP (tem)) continue; |
if (!NILP (tem)) continue; |
3273 |
} |
} |
3274 |
|
|
3275 |
/* Set CHARACTER to the character this entry describes, if any. |
character = make_number (starting_i); |
|
Also update *INDICES. */ |
|
|
if (CHAR_TABLE_P (vector)) |
|
|
{ |
|
|
indices[char_table_depth] = i; |
|
|
|
|
|
if (char_table_depth == 0) |
|
|
{ |
|
|
character = i; |
|
|
indices[0] = i - 128; |
|
|
} |
|
|
else if (complete_char) |
|
|
{ |
|
|
character = MAKE_CHAR (indices[0], indices[1], indices[2]); |
|
|
} |
|
|
else |
|
|
character = 0; |
|
|
} |
|
|
else |
|
|
character = i; |
|
3276 |
|
|
3277 |
/* If this binding is shadowed by some other map, ignore it. */ |
/* If this binding is shadowed by some other map, ignore it. */ |
3278 |
if (!NILP (shadow) && complete_char) |
if (!NILP (shadow)) |
3279 |
{ |
{ |
3280 |
Lisp_Object tem; |
Lisp_Object tem; |
3281 |
|
|
3282 |
ASET (kludge, 0, make_number (character)); |
ASET (kludge, 0, character); |
3283 |
tem = shadow_lookup (shadow, kludge, Qt); |
tem = shadow_lookup (shadow, kludge, Qt); |
3284 |
|
|
3285 |
if (!NILP (tem)) continue; |
if (!NILP (tem)) continue; |
3287 |
|
|
3288 |
/* Ignore this definition if it is shadowed by an earlier |
/* Ignore this definition if it is shadowed by an earlier |
3289 |
one in the same keymap. */ |
one in the same keymap. */ |
3290 |
if (!NILP (entire_map) && complete_char) |
if (!NILP (entire_map)) |
3291 |
{ |
{ |
3292 |
Lisp_Object tem; |
Lisp_Object tem; |
3293 |
|
|
3294 |
ASET (kludge, 0, make_number (character)); |
ASET (kludge, 0, character); |
3295 |
tem = Flookup_key (entire_map, kludge, Qt); |
tem = Flookup_key (entire_map, kludge, Qt); |
3296 |
|
|
3297 |
if (!EQ (tem, definition)) |
if (!EQ (tem, definition)) |
3300 |
|
|
3301 |
if (first) |
if (first) |
3302 |
{ |
{ |
3303 |
if (char_table_depth == 0) |
insert ("\n", 1); |
|
insert ("\n", 1); |
|
3304 |
first = 0; |
first = 0; |
3305 |
} |
} |
3306 |
|
|
|
/* For a sub char-table, show the depth by indentation. |
|
|
CHAR_TABLE_DEPTH can be greater than 0 only for a char-table. */ |
|
|
if (char_table_depth > 0) |
|
|
insert (" ", char_table_depth * 2); /* depth is 1 or 2. */ |
|
|
|
|
3307 |
/* Output the prefix that applies to every entry in this map. */ |
/* Output the prefix that applies to every entry in this map. */ |
3308 |
if (!NILP (elt_prefix)) |
if (!NILP (elt_prefix)) |
3309 |
insert1 (elt_prefix); |
insert1 (elt_prefix); |
3310 |
|
|
3311 |
/* Insert or describe the character this slot is for, |
insert1 (Fsingle_key_description (character, Qnil)); |
|
or a description of what it is for. */ |
|
|
if (SUB_CHAR_TABLE_P (vector)) |
|
|
{ |
|
|
if (complete_char) |
|
|
insert_char (character); |
|
|
else |
|
|
{ |
|
|
/* We need an octal representation for this block of |
|
|
characters. */ |
|
|
char work[16]; |
|
|
sprintf (work, "(row %d)", i); |
|
|
insert (work, strlen (work)); |
|
|
} |
|
|
} |
|
|
else if (CHAR_TABLE_P (vector)) |
|
|
{ |
|
|
if (complete_char) |
|
|
insert1 (Fsingle_key_description (make_number (character), Qnil)); |
|
|
else |
|
|
{ |
|
|
/* Print the information for this character set. */ |
|
|
insert_string ("<"); |
|
|
tem2 = CHARSET_TABLE_INFO (i - 128, CHARSET_SHORT_NAME_IDX); |
|
|
if (STRINGP (tem2)) |
|
|
insert_from_string (tem2, 0, 0, SCHARS (tem2), |
|
|
SBYTES (tem2), 0); |
|
|
else |
|
|
insert ("?", 1); |
|
|
insert (">", 1); |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
insert1 (Fsingle_key_description (make_number (character), Qnil)); |
|
|
} |
|
|
|
|
|
/* If we find a sub char-table within a char-table, |
|
|
scan it recursively; it defines the details for |
|
|
a character set or a portion of a character set. */ |
|
|
if (CHAR_TABLE_P (vector) && SUB_CHAR_TABLE_P (definition)) |
|
|
{ |
|
|
insert ("\n", 1); |
|
|
describe_vector (definition, elt_prefix, args, elt_describer, |
|
|
partial, shadow, entire_map, |
|
|
indices, char_table_depth + 1); |
|
|
continue; |
|
|
} |
|
|
|
|
|
starting_i = i; |
|
3312 |
|
|
3313 |
/* Find all consecutive characters or rows that have the same |
/* Find all consecutive characters or rows that have the same |
3314 |
definition. But, for elements of a top level char table, if |
definition. But, for elements of a top level char table, if |
3315 |
they are for charsets, we had better describe one by one even |
they are for charsets, we had better describe one by one even |
3316 |
if they have the same definition. */ |
if they have the same definition. */ |
3317 |
if (CHAR_TABLE_P (vector)) |
if (CHAR_TABLE_P (vector)) |
3318 |
{ |
while (i + 1 < to |
3319 |
int limit = to; |
&& (val = char_table_ref_and_range (vector, i + 1, |
3320 |
|
&range_beg, &range_end), |
3321 |
if (char_table_depth == 0) |
tem2 = get_keyelt (val, 0), |
3322 |
limit = CHAR_TABLE_SINGLE_BYTE_SLOTS; |
!NILP (tem2)) |
3323 |
|
&& !NILP (Fequal (tem2, definition))) |
3324 |
while (i + 1 < limit |
i = range_end; |
|
&& (tem2 = get_keyelt (XCHAR_TABLE (vector)->contents[i + 1], 0), |
|
|
!NILP (tem2)) |
|
|
&& !NILP (Fequal (tem2, definition))) |
|
|
i++; |
|
|
} |
|
3325 |
else |
else |
3326 |
while (i + 1 < to |
while (i + 1 < to |
3327 |
&& (tem2 = get_keyelt (AREF (vector, i + 1), 0), |
&& (tem2 = get_keyelt (AREF (vector, i + 1), 0), |
3329 |
&& !NILP (Fequal (tem2, definition))) |
&& !NILP (Fequal (tem2, definition))) |
3330 |
i++; |
i++; |
3331 |
|
|
|
|
|
3332 |
/* If we have a range of more than one character, |
/* If we have a range of more than one character, |
3333 |
print where the range reaches to. */ |
print where the range reaches to. */ |
3334 |
|
|
3339 |
if (!NILP (elt_prefix)) |
if (!NILP (elt_prefix)) |
3340 |
insert1 (elt_prefix); |
insert1 (elt_prefix); |
3341 |
|
|
3342 |
if (CHAR_TABLE_P (vector)) |
insert1 (Fsingle_key_description (make_number (i), Qnil)); |
|
{ |
|
|
if (char_table_depth == 0) |
|
|
{ |
|
|
insert1 (Fsingle_key_description (make_number (i), Qnil)); |
|
|
} |
|
|
else if (complete_char) |
|
|
{ |
|
|
indices[char_table_depth] = i; |
|
|
character = MAKE_CHAR (indices[0], indices[1], indices[2]); |
|
|
insert_char (character); |
|
|
} |
|
|
else |
|
|
{ |
|
|
/* We need an octal representation for this block of |
|
|
characters. */ |
|
|
char work[16]; |
|
|
sprintf (work, "(row %d)", i); |
|
|
insert (work, strlen (work)); |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
insert1 (Fsingle_key_description (make_number (i), Qnil)); |
|
|
} |
|
3343 |
} |
} |
3344 |
|
|
3345 |
/* Print a description of the definition of this character. |
/* Print a description of the definition of this character. |
3348 |
(*elt_describer) (definition, args); |
(*elt_describer) (definition, args); |
3349 |
} |
} |
3350 |
|
|
|
/* For (sub) char-table, print `defalt' slot at last. */ |
|
|
if (CHAR_TABLE_P (vector) && !NILP (XCHAR_TABLE (vector)->defalt)) |
|
|
{ |
|
|
insert (" ", char_table_depth * 2); |
|
|
insert_string ("<<default>>"); |
|
|
(*elt_describer) (XCHAR_TABLE (vector)->defalt, args); |
|
|
} |
|
|
|
|
3351 |
UNGCPRO; |
UNGCPRO; |
3352 |
} |
} |
3353 |
|
|