aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-05-30 05:11:26 +0000
committerRichard M. Stallman1997-05-30 05:11:26 +0000
commite814a15920cf817330a9336e5987df57c12d8e91 (patch)
tree1fd98ce47ec56ffe466f7d79b53091b6a9a72344 /src
parent50be475d120ff32d4ff3ab3d3497d4156cf7d480 (diff)
downloademacs-e814a15920cf817330a9336e5987df57c12d8e91.tar.gz
emacs-e814a15920cf817330a9336e5987df57c12d8e91.zip
(Fchar_table_range, Fset_char_table_range):
Make one-element vector work for RANGE.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/fns.c b/src/fns.c
index b912071a5f8..69bcb6f7d86 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1315,12 +1315,17 @@ or a character code.")
1315 return Faref (char_table, range); 1315 return Faref (char_table, range);
1316 else if (VECTORP (range)) 1316 else if (VECTORP (range))
1317 { 1317 {
1318 int size = XVECTOR (range)->size; 1318 if (XVECTOR (range)->size == 1)
1319 Lisp_Object *val = XVECTOR (range)->contents; 1319 return Faref (char_table, XVECTOR (range)->contents[0]);
1320 Lisp_Object ch = Fmake_char_internal (size <= 0 ? Qnil : val[0], 1320 else
1321 size <= 1 ? Qnil : val[1], 1321 {
1322 size <= 2 ? Qnil : val[2]); 1322 int size = XVECTOR (range)->size;
1323 return Faref (char_table, ch); 1323 Lisp_Object *val = XVECTOR (range)->contents;
1324 Lisp_Object ch = Fmake_char_internal (size <= 0 ? Qnil : val[0],
1325 size <= 1 ? Qnil : val[1],
1326 size <= 2 ? Qnil : val[2]);
1327 return Faref (char_table, ch);
1328 }
1324 } 1329 }
1325 else 1330 else
1326 error ("Invalid RANGE argument to `char-table-range'"); 1331 error ("Invalid RANGE argument to `char-table-range'");
@@ -1348,12 +1353,17 @@ or a character code.")
1348 Faset (char_table, range, value); 1353 Faset (char_table, range, value);
1349 else if (VECTORP (range)) 1354 else if (VECTORP (range))
1350 { 1355 {
1351 int size = XVECTOR (range)->size; 1356 if (XVECTOR (range)->size == 1)
1352 Lisp_Object *val = XVECTOR (range)->contents; 1357 return Faset (char_table, XVECTOR (range)->contents[0], value);
1353 Lisp_Object ch = Fmake_char_internal (size <= 0 ? Qnil : val[0], 1358 else
1354 size <= 1 ? Qnil : val[1], 1359 {
1355 size <= 2 ? Qnil : val[2]); 1360 int size = XVECTOR (range)->size;
1356 return Faset (char_table, ch, value); 1361 Lisp_Object *val = XVECTOR (range)->contents;
1362 Lisp_Object ch = Fmake_char_internal (size <= 0 ? Qnil : val[0],
1363 size <= 1 ? Qnil : val[1],
1364 size <= 2 ? Qnil : val[2]);
1365 return Faset (char_table, ch, value);
1366 }
1357 } 1367 }
1358 else 1368 else
1359 error ("Invalid RANGE argument to `set-char-table-range'"); 1369 error ("Invalid RANGE argument to `set-char-table-range'");