aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2005-04-20 07:50:59 +0000
committerKenichi Handa2005-04-20 07:50:59 +0000
commit2b048bf56106f9818da25051f7608c57cb884396 (patch)
tree08104831c0c9c7b7ae948e459edc42c83da0ccd2 /src
parent256d566c94e35486a941b170ddc97deda4edc545 (diff)
downloademacs-2b048bf56106f9818da25051f7608c57cb884396.tar.gz
emacs-2b048bf56106f9818da25051f7608c57cb884396.zip
(Fset_char_table_range): Don't set slots used as default
values for ascii, eight-bit-control, eight-bit-graphic. Don't call Faref with charset-id. (Fset_char_table_default): Document how to treat normal character argument. Handle special slots used as default values of ascii, eight-bit-control, eight-bit-control. Make a sub chartable if necessary.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog23
-rw-r--r--src/fns.c59
2 files changed, 57 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5fde4ff5286..8b01a1a6bb7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,28 @@
12005-04-20 Kenichi Handa <handa@m17n.org> 12005-04-20 Kenichi Handa <handa@m17n.org>
2 2
3 * lisp.h (CHAR_TABLE_DEFAULT_SLOT_ASCII): New macro.
4 (CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL): New macro.
5 (CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC): New macro.
6
7 * alloc.c (make_sub_char_table): Argument changed to initial
8 value of the slots.
9
10 * data.c (Faref): Handle special slots used as default values of
11 ascii, eight-bit-control, eight-bit-control. Don't ignore a
12 default value set for a group of characters.
13 (Faset): Signal an error if IDXVAL is not a valid character code.
14 Make a sub-chartable with correct initial value.
15
16 * fns.c (Fset_char_table_range): Don't set slots used as default
17 values for ascii, eight-bit-control, eight-bit-graphic. Don't
18 call Faref with charset-id.
19 (Fset_char_table_default): Document how to treat normal character
20 argument. Handle special slots used as default values of ascii,
21 eight-bit-control, eight-bit-control. Make a sub chartable if
22 necessary.
23
242005-04-20 Kenichi Handa <handa@m17n.org>
25
3 * search.c (boyer_moore): Fix previous change. 26 * search.c (boyer_moore): Fix previous change.
4 27
52005-04-19 Kim F. Storm <storm@cua.dk> 282005-04-19 Kim F. Storm <storm@cua.dk>
diff --git a/src/fns.c b/src/fns.c
index 088b6ca500d..bad4da80959 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2578,7 +2578,14 @@ character set, or a character code. Return VALUE. */)
2578 2578
2579 if (EQ (range, Qt)) 2579 if (EQ (range, Qt))
2580 for (i = 0; i < CHAR_TABLE_ORDINARY_SLOTS; i++) 2580 for (i = 0; i < CHAR_TABLE_ORDINARY_SLOTS; i++)
2581 XCHAR_TABLE (char_table)->contents[i] = value; 2581 {
2582 /* Don't set these special slots used for default values of
2583 ascii, eight-bit-control, and eight-bit-graphic. */
2584 if (i != CHAR_TABLE_DEFAULT_SLOT_ASCII
2585 && i != CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL
2586 && i != CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC)
2587 XCHAR_TABLE (char_table)->contents[i] = value;
2588 }
2582 else if (EQ (range, Qnil)) 2589 else if (EQ (range, Qnil))
2583 XCHAR_TABLE (char_table)->defalt = value; 2590 XCHAR_TABLE (char_table)->defalt = value;
2584 else if (SYMBOLP (range)) 2591 else if (SYMBOLP (range))
@@ -2609,19 +2616,12 @@ character set, or a character code. Return VALUE. */)
2609 Faset (char_table, range, value); 2616 Faset (char_table, range, value);
2610 else if (VECTORP (range)) 2617 else if (VECTORP (range))
2611 { 2618 {
2612 if (XVECTOR (range)->size == 1) 2619 int size = XVECTOR (range)->size;
2613 return Faset (char_table, 2620 Lisp_Object *val = XVECTOR (range)->contents;
2614 make_number (XINT (XVECTOR (range)->contents[0]) + 128), 2621 Lisp_Object ch = Fmake_char_internal (size <= 0 ? Qnil : val[0],
2615 value); 2622 size <= 1 ? Qnil : val[1],
2616 else 2623 size <= 2 ? Qnil : val[2]);
2617 { 2624 Faset (char_table, ch, value);
2618 int size = XVECTOR (range)->size;
2619 Lisp_Object *val = XVECTOR (range)->contents;
2620 Lisp_Object ch = Fmake_char_internal (size <= 0 ? Qnil : val[0],
2621 size <= 1 ? Qnil : val[1],
2622 size <= 2 ? Qnil : val[2]);
2623 return Faset (char_table, ch, value);
2624 }
2625 } 2625 }
2626 else 2626 else
2627 error ("Invalid RANGE argument to `set-char-table-range'"); 2627 error ("Invalid RANGE argument to `set-char-table-range'");
@@ -2633,6 +2633,8 @@ DEFUN ("set-char-table-default", Fset_char_table_default,
2633 Sset_char_table_default, 3, 3, 0, 2633 Sset_char_table_default, 3, 3, 0,
2634 doc: /* Set the default value in CHAR-TABLE for generic character CH to VALUE. 2634 doc: /* Set the default value in CHAR-TABLE for generic character CH to VALUE.
2635The generic character specifies the group of characters. 2635The generic character specifies the group of characters.
2636If CH is a normal character, set the default value for a group of
2637characters to which CH belongs.
2636See also the documentation of `make-char'. */) 2638See also the documentation of `make-char'. */)
2637 (char_table, ch, value) 2639 (char_table, ch, value)
2638 Lisp_Object char_table, ch, value; 2640 Lisp_Object char_table, ch, value;
@@ -2652,27 +2654,34 @@ See also the documentation of `make-char'. */)
2652 if (! CHARSET_VALID_P (charset)) 2654 if (! CHARSET_VALID_P (charset))
2653 invalid_character (c); 2655 invalid_character (c);
2654 2656
2655 if (charset == CHARSET_ASCII) 2657 if (SINGLE_BYTE_CHAR_P (c))
2656 return (XCHAR_TABLE (char_table)->defalt = value); 2658 {
2659 /* We use special slots for the default values of single byte
2660 characters. */
2661 int default_slot
2662 = (c < 0x80 ? CHAR_TABLE_DEFAULT_SLOT_ASCII
2663 : c < 0xA0 ? CHAR_TABLE_DEFAULT_SLOT_8_BIT_CONTROL
2664 : CHAR_TABLE_DEFAULT_SLOT_8_BIT_GRAPHIC);
2665
2666 return (XCHAR_TABLE (char_table)->contents[default_slot] = value);
2667 }
2657 2668
2658 /* Even if C is not a generic char, we had better behave as if a 2669 /* Even if C is not a generic char, we had better behave as if a
2659 generic char is specified. */ 2670 generic char is specified. */
2660 if (!CHARSET_DEFINED_P (charset) || CHARSET_DIMENSION (charset) == 1) 2671 if (!CHARSET_DEFINED_P (charset) || CHARSET_DIMENSION (charset) == 1)
2661 code1 = 0; 2672 code1 = 0;
2662 temp = XCHAR_TABLE (char_table)->contents[charset + 128]; 2673 temp = XCHAR_TABLE (char_table)->contents[charset + 128];
2674 if (! SUB_CHAR_TABLE_P (temp))
2675 {
2676 temp = make_sub_char_table (temp);
2677 XCHAR_TABLE (char_table)->contents[charset + 128] = temp;
2678 }
2663 if (!code1) 2679 if (!code1)
2664 { 2680 {
2665 if (SUB_CHAR_TABLE_P (temp)) 2681 XCHAR_TABLE (temp)->defalt = value;
2666 XCHAR_TABLE (temp)->defalt = value;
2667 else
2668 XCHAR_TABLE (char_table)->contents[charset + 128] = value;
2669 return value; 2682 return value;
2670 } 2683 }
2671 if (SUB_CHAR_TABLE_P (temp)) 2684 char_table = temp;
2672 char_table = temp;
2673 else
2674 char_table = (XCHAR_TABLE (char_table)->contents[charset + 128]
2675 = make_sub_char_table (temp));
2676 temp = XCHAR_TABLE (char_table)->contents[code1]; 2685 temp = XCHAR_TABLE (char_table)->contents[code1];
2677 if (SUB_CHAR_TABLE_P (temp)) 2686 if (SUB_CHAR_TABLE_P (temp))
2678 XCHAR_TABLE (temp)->defalt = value; 2687 XCHAR_TABLE (temp)->defalt = value;