186 |
int from, to; |
int from, to; |
187 |
|
|
188 |
if (NATNUMP (elt)) |
if (NATNUMP (elt)) |
189 |
|
Fset_char_table_range (canon, range, Faref (case_table, Faref (up, elt))); |
190 |
|
} |
191 |
|
|
192 |
|
/* Set elements of char-table TABLE for characters in RANGE to |
193 |
|
themselves. This is done only when ELT is a character. This is |
194 |
|
called in map_char_table. */ |
195 |
|
|
196 |
|
static void |
197 |
|
set_identity (table, range, elt) |
198 |
|
Lisp_Object table, range, elt; |
199 |
|
{ |
200 |
|
int from, to; |
201 |
|
|
202 |
|
if (NATNUMP (elt)) |
203 |
{ |
{ |
204 |
if (CONSP (range)) |
if (CONSP (range)) |
205 |
{ |
{ |
210 |
from = to = XINT (range); |
from = to = XINT (range); |
211 |
|
|
212 |
for (; from <= to; from++) |
for (; from <= to; from++) |
213 |
{ |
CHAR_TABLE_SET (table, from, make_number (from)); |
|
Lisp_Object val1, val2; |
|
|
|
|
|
val1 = Faref (up, elt); |
|
|
if (EQ (val1, Qt)) |
|
|
val1 = elt; |
|
|
else if (! NATNUMP (val1)) |
|
|
continue; |
|
|
val2 = Faref (case_table, val1); |
|
|
if (EQ (val2, Qt)) |
|
|
val2 = val1; |
|
|
else if (! NATNUMP (val2)) |
|
|
continue; |
|
|
Faset (canon, make_number (from), val2); |
|
|
} |
|
214 |
} |
} |
215 |
} |
} |
216 |
|
|
|
/* Set elements of char-table TABLE for characters in RANGE to |
|
|
themselves. This is done only when ELT is a character. This is |
|
|
called in map_char_table. */ |
|
|
|
|
|
static void |
|
|
set_identity (table, range, elt) |
|
|
Lisp_Object table, range, elt; |
|
|
{ |
|
|
if (EQ (elt, Qt) || NATNUMP (elt)) |
|
|
Fset_char_table_range (table, range, Qt); |
|
|
} |
|
|
|
|
217 |
/* Permute the elements of TABLE (which is initially an identity |
/* Permute the elements of TABLE (which is initially an identity |
218 |
mapping) so that it has one cycle for each equivalence class |
mapping) so that it has one cycle for each equivalence class |
219 |
induced by the translation table on which map_char_table is |
induced by the translation table on which map_char_table is |
227 |
|
|
228 |
if (NATNUMP (elt)) |
if (NATNUMP (elt)) |
229 |
{ |
{ |
230 |
Lisp_Object tem; |
Lisp_Object tem = Faref (table, elt); |
231 |
|
|
232 |
if (CONSP (range)) |
if (CONSP (range)) |
233 |
{ |
{ |
240 |
for (; from <= to; from++) |
for (; from <= to; from++) |
241 |
if (from != XINT (elt)) |
if (from != XINT (elt)) |
242 |
{ |
{ |
|
tem = Faref (table, elt); |
|
|
if (EQ (tem, Qt)) |
|
|
tem = elt; |
|
243 |
Faset (table, elt, make_number (from)); |
Faset (table, elt, make_number (from)); |
244 |
Faset (table, make_number (from), tem); |
Faset (table, make_number (from), tem); |
245 |
} |
} |