Mercurial > hg > xemacs-beta
comparison src/chartab.c @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | abe6d1db359e |
children | 3d3049ae1304 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
466 assigned values are | 466 assigned values are |
467 | 467 |
468 -- all characters | 468 -- all characters |
469 -- a single character | 469 -- a single character |
470 | 470 |
471 To create a char table, use `make-char-table'. To modify a char | 471 To create a char table, use `make-char-table'. |
472 table, use `put-char-table' or `remove-char-table'. To retrieve the | 472 To modify a char table, use `put-char-table' or `remove-char-table'. |
473 value for a particular character, use `get-char-table'. See also | 473 To retrieve the value for a particular character, use `get-char-table'. |
474 `map-char-table', `clear-char-table', `copy-char-table', | 474 See also `map-char-table', `clear-char-table', `copy-char-table', |
475 `valid-char-table-type-p', `char-table-type-list', `valid-char-table-value-p', | 475 `valid-char-table-type-p', `char-table-type-list', |
476 and `check-char-table-value'. | 476 `valid-char-table-value-p', and `check-char-table-value'. |
477 */ | 477 */ |
478 (object)) | 478 (object)) |
479 { | 479 { |
480 return CHAR_TABLEP (object) ? Qt : Qnil; | 480 return CHAR_TABLEP (object) ? Qt : Qnil; |
481 } | 481 } |
531 EQ (type, Qgeneric) || | 531 EQ (type, Qgeneric) || |
532 EQ (type, Qsyntax)) ? Qt : Qnil; | 532 EQ (type, Qsyntax)) ? Qt : Qnil; |
533 } | 533 } |
534 | 534 |
535 DEFUN ("char-table-type", Fchar_table_type, 1, 1, 0, /* | 535 DEFUN ("char-table-type", Fchar_table_type, 1, 1, 0, /* |
536 Return the type of char table TABLE. | 536 Return the type of CHAR-TABLE. |
537 See `valid-char-table-type-p'. | 537 See `valid-char-table-type-p'. |
538 */ | 538 */ |
539 (table)) | 539 (char_table)) |
540 { | 540 { |
541 CHECK_CHAR_TABLE (table); | 541 CHECK_CHAR_TABLE (char_table); |
542 return char_table_type_to_symbol (XCHAR_TABLE (table)->type); | 542 return char_table_type_to_symbol (XCHAR_TABLE (char_table)->type); |
543 } | 543 } |
544 | 544 |
545 void | 545 void |
546 fill_char_table (Lisp_Char_Table *ct, Lisp_Object value) | 546 fill_char_table (Lisp_Char_Table *ct, Lisp_Object value) |
547 { | 547 { |
557 if (ct->type == CHAR_TABLE_TYPE_SYNTAX) | 557 if (ct->type == CHAR_TABLE_TYPE_SYNTAX) |
558 update_syntax_table (ct); | 558 update_syntax_table (ct); |
559 } | 559 } |
560 | 560 |
561 DEFUN ("reset-char-table", Freset_char_table, 1, 1, 0, /* | 561 DEFUN ("reset-char-table", Freset_char_table, 1, 1, 0, /* |
562 Reset a char table to its default state. | 562 Reset CHAR-TABLE to its default state. |
563 */ | 563 */ |
564 (table)) | 564 (char_table)) |
565 { | 565 { |
566 Lisp_Char_Table *ct; | 566 Lisp_Char_Table *ct; |
567 | 567 |
568 CHECK_CHAR_TABLE (table); | 568 CHECK_CHAR_TABLE (char_table); |
569 ct = XCHAR_TABLE (table); | 569 ct = XCHAR_TABLE (char_table); |
570 | 570 |
571 switch (ct->type) | 571 switch (ct->type) |
572 { | 572 { |
573 case CHAR_TABLE_TYPE_CHAR: | 573 case CHAR_TABLE_TYPE_CHAR: |
574 fill_char_table (ct, make_char (0)); | 574 fill_char_table (ct, make_char (0)); |
664 } | 664 } |
665 | 665 |
666 #endif /* MULE */ | 666 #endif /* MULE */ |
667 | 667 |
668 DEFUN ("copy-char-table", Fcopy_char_table, 1, 1, 0, /* | 668 DEFUN ("copy-char-table", Fcopy_char_table, 1, 1, 0, /* |
669 Make a new char table which is a copy of OLD-TABLE. | 669 Return a new char table which is a copy of CHAR-TABLE. |
670 It will contain the same values for the same characters and ranges | 670 It will contain the same values for the same characters and ranges |
671 as OLD-TABLE. The values will not themselves be copied. | 671 as CHAR-TABLE. The values will not themselves be copied. |
672 */ | 672 */ |
673 (old_table)) | 673 (char_table)) |
674 { | 674 { |
675 Lisp_Char_Table *ct, *ctnew; | 675 Lisp_Char_Table *ct, *ctnew; |
676 Lisp_Object obj; | 676 Lisp_Object obj; |
677 int i; | 677 int i; |
678 | 678 |
679 CHECK_CHAR_TABLE (old_table); | 679 CHECK_CHAR_TABLE (char_table); |
680 ct = XCHAR_TABLE (old_table); | 680 ct = XCHAR_TABLE (char_table); |
681 ctnew = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table); | 681 ctnew = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table); |
682 ctnew->type = ct->type; | 682 ctnew->type = ct->type; |
683 | 683 |
684 for (i = 0; i < NUM_ASCII_CHARS; i++) | 684 for (i = 0; i < NUM_ASCII_CHARS; i++) |
685 { | 685 { |
840 #endif /* not MULE */ | 840 #endif /* not MULE */ |
841 } | 841 } |
842 | 842 |
843 | 843 |
844 DEFUN ("get-char-table", Fget_char_table, 2, 2, 0, /* | 844 DEFUN ("get-char-table", Fget_char_table, 2, 2, 0, /* |
845 Find value for char CH in TABLE. | 845 Find value for CHARACTER in CHAR-TABLE. |
846 */ | 846 */ |
847 (ch, table)) | 847 (character, char_table)) |
848 { | 848 { |
849 Lisp_Char_Table *ct; | 849 CHECK_CHAR_TABLE (char_table); |
850 | 850 CHECK_CHAR_COERCE_INT (character); |
851 CHECK_CHAR_TABLE (table); | 851 |
852 ct = XCHAR_TABLE (table); | 852 return get_char_table (XCHAR (character), XCHAR_TABLE (char_table)); |
853 CHECK_CHAR_COERCE_INT (ch); | |
854 | |
855 return get_char_table (XCHAR (ch), ct); | |
856 } | 853 } |
857 | 854 |
858 DEFUN ("get-range-char-table", Fget_range_char_table, 2, 3, 0, /* | 855 DEFUN ("get-range-char-table", Fget_range_char_table, 2, 3, 0, /* |
859 Find value for a range in TABLE. | 856 Find value for a range in CHAR-TABLE. |
860 If there is more than one value, return MULTI (defaults to nil). | 857 If there is more than one value, return MULTI (defaults to nil). |
861 */ | 858 */ |
862 (range, table, multi)) | 859 (range, char_table, multi)) |
863 { | 860 { |
864 Lisp_Char_Table *ct; | 861 Lisp_Char_Table *ct; |
865 struct chartab_range rainj; | 862 struct chartab_range rainj; |
866 | 863 |
867 if (CHAR_OR_CHAR_INTP (range)) | 864 if (CHAR_OR_CHAR_INTP (range)) |
868 return Fget_char_table (range, table); | 865 return Fget_char_table (range, char_table); |
869 CHECK_CHAR_TABLE (table); | 866 CHECK_CHAR_TABLE (char_table); |
870 ct = XCHAR_TABLE (table); | 867 ct = XCHAR_TABLE (char_table); |
871 | 868 |
872 decode_char_table_range (range, &rainj); | 869 decode_char_table_range (range, &rainj); |
873 switch (rainj.type) | 870 switch (rainj.type) |
874 { | 871 { |
875 case CHARTAB_RANGE_ALL: | 872 case CHARTAB_RANGE_ALL: |
1136 if (ct->type == CHAR_TABLE_TYPE_SYNTAX) | 1133 if (ct->type == CHAR_TABLE_TYPE_SYNTAX) |
1137 update_syntax_table (ct); | 1134 update_syntax_table (ct); |
1138 } | 1135 } |
1139 | 1136 |
1140 DEFUN ("put-char-table", Fput_char_table, 3, 3, 0, /* | 1137 DEFUN ("put-char-table", Fput_char_table, 3, 3, 0, /* |
1141 Set the value for chars in RANGE to be VAL in TABLE. | 1138 Set the value for chars in RANGE to be VALUE in CHAR-TABLE. |
1142 | 1139 |
1143 RANGE specifies one or more characters to be affected and should be | 1140 RANGE specifies one or more characters to be affected and should be |
1144 one of the following: | 1141 one of the following: |
1145 | 1142 |
1146 -- t (all characters are affected) | 1143 -- t (all characters are affected) |
1147 -- A charset (only allowed when Mule support is present) | 1144 -- A charset (only allowed when Mule support is present) |
1148 -- A vector of two elements: a two-octet charset and a row number | 1145 -- A vector of two elements: a two-octet charset and a row number |
1149 (only allowed when Mule support is present) | 1146 (only allowed when Mule support is present) |
1150 -- A single character | 1147 -- A single character |
1151 | 1148 |
1152 VAL must be a value appropriate for the type of TABLE. | 1149 VALUE must be a value appropriate for the type of CHAR-TABLE. |
1153 See `valid-char-table-type-p'. | 1150 See `valid-char-table-type-p'. |
1154 */ | 1151 */ |
1155 (range, val, table)) | 1152 (range, value, char_table)) |
1156 { | 1153 { |
1157 Lisp_Char_Table *ct; | 1154 Lisp_Char_Table *ct; |
1158 struct chartab_range rainj; | 1155 struct chartab_range rainj; |
1159 | 1156 |
1160 CHECK_CHAR_TABLE (table); | 1157 CHECK_CHAR_TABLE (char_table); |
1161 ct = XCHAR_TABLE (table); | 1158 ct = XCHAR_TABLE (char_table); |
1162 check_valid_char_table_value (val, ct->type, ERROR_ME); | 1159 check_valid_char_table_value (value, ct->type, ERROR_ME); |
1163 decode_char_table_range (range, &rainj); | 1160 decode_char_table_range (range, &rainj); |
1164 val = canonicalize_char_table_value (val, ct->type); | 1161 value = canonicalize_char_table_value (value, ct->type); |
1165 put_char_table (ct, &rainj, val); | 1162 put_char_table (ct, &rainj, value); |
1166 return Qnil; | 1163 return Qnil; |
1167 } | 1164 } |
1168 | 1165 |
1169 /* Map FN over the ASCII chars in CT. */ | 1166 /* Map FN over the ASCII chars in CT. */ |
1170 | 1167 |
1438 closure->retval = call2 (closure->function, ranjarg, val); | 1435 closure->retval = call2 (closure->function, ranjarg, val); |
1439 return !NILP (closure->retval); | 1436 return !NILP (closure->retval); |
1440 } | 1437 } |
1441 | 1438 |
1442 DEFUN ("map-char-table", Fmap_char_table, 2, 3, 0, /* | 1439 DEFUN ("map-char-table", Fmap_char_table, 2, 3, 0, /* |
1443 Map FUNCTION over entries in TABLE, calling it with two args, | 1440 Map FUNCTION over entries in CHAR-TABLE, calling it with two args, |
1444 each key and value in the table. | 1441 each key and value in the table. |
1445 | 1442 |
1446 RANGE specifies a subrange to map over and is in the same format as | 1443 RANGE specifies a subrange to map over and is in the same format as |
1447 the RANGE argument to `put-range-table'. If omitted or t, it defaults to | 1444 the RANGE argument to `put-range-table'. If omitted or t, it defaults to |
1448 the entire table. | 1445 the entire table. |
1449 */ | 1446 */ |
1450 (function, table, range)) | 1447 (function, char_table, range)) |
1451 { | 1448 { |
1452 Lisp_Char_Table *ct; | 1449 Lisp_Char_Table *ct; |
1453 struct slow_map_char_table_arg slarg; | 1450 struct slow_map_char_table_arg slarg; |
1454 struct gcpro gcpro1, gcpro2; | 1451 struct gcpro gcpro1, gcpro2; |
1455 struct chartab_range rainj; | 1452 struct chartab_range rainj; |
1456 | 1453 |
1457 CHECK_CHAR_TABLE (table); | 1454 CHECK_CHAR_TABLE (char_table); |
1458 ct = XCHAR_TABLE (table); | 1455 ct = XCHAR_TABLE (char_table); |
1459 if (NILP (range)) | 1456 if (NILP (range)) |
1460 range = Qt; | 1457 range = Qt; |
1461 decode_char_table_range (range, &rainj); | 1458 decode_char_table_range (range, &rainj); |
1462 slarg.function = function; | 1459 slarg.function = function; |
1463 slarg.retval = Qnil; | 1460 slarg.retval = Qnil; |
1570 /************************************************************************/ | 1567 /************************************************************************/ |
1571 /* Category Tables, specifically */ | 1568 /* Category Tables, specifically */ |
1572 /************************************************************************/ | 1569 /************************************************************************/ |
1573 | 1570 |
1574 DEFUN ("category-table-p", Fcategory_table_p, 1, 1, 0, /* | 1571 DEFUN ("category-table-p", Fcategory_table_p, 1, 1, 0, /* |
1575 Return t if ARG is a category table. | 1572 Return t if OBJECT is a category table. |
1576 A category table is a type of char table used for keeping track of | 1573 A category table is a type of char table used for keeping track of |
1577 categories. Categories are used for classifying characters for use | 1574 categories. Categories are used for classifying characters for use |
1578 in regexps -- you can refer to a category rather than having to use | 1575 in regexps -- you can refer to a category rather than having to use |
1579 a complicated [] expression (and category lookups are significantly | 1576 a complicated [] expression (and category lookups are significantly |
1580 faster). | 1577 faster). |
1593 whether the character is in that category. | 1590 whether the character is in that category. |
1594 | 1591 |
1595 Special Lisp functions are provided that abstract this, so you do not | 1592 Special Lisp functions are provided that abstract this, so you do not |
1596 have to directly manipulate bit vectors. | 1593 have to directly manipulate bit vectors. |
1597 */ | 1594 */ |
1598 (obj)) | 1595 (object)) |
1599 { | 1596 { |
1600 return (CHAR_TABLEP (obj) && | 1597 return (CHAR_TABLEP (object) && |
1601 XCHAR_TABLE_TYPE (obj) == CHAR_TABLE_TYPE_CATEGORY) ? | 1598 XCHAR_TABLE_TYPE (object) == CHAR_TABLE_TYPE_CATEGORY) ? |
1602 Qt : Qnil; | 1599 Qt : Qnil; |
1603 } | 1600 } |
1604 | 1601 |
1605 static Lisp_Object | 1602 static Lisp_Object |
1606 check_category_table (Lisp_Object obj, Lisp_Object def) | 1603 check_category_table (Lisp_Object object, Lisp_Object default_) |
1607 { | 1604 { |
1608 if (NILP (obj)) | 1605 if (NILP (object)) |
1609 obj = def; | 1606 object = default_; |
1610 while (NILP (Fcategory_table_p (obj))) | 1607 while (NILP (Fcategory_table_p (object))) |
1611 obj = wrong_type_argument (Qcategory_table_p, obj); | 1608 object = wrong_type_argument (Qcategory_table_p, object); |
1612 return obj; | 1609 return object; |
1613 } | 1610 } |
1614 | 1611 |
1615 int | 1612 int |
1616 check_category_char (Emchar ch, Lisp_Object table, | 1613 check_category_char (Emchar ch, Lisp_Object table, |
1617 unsigned int designator, unsigned int not) | 1614 unsigned int designator, unsigned int not) |
1630 designator -= ' '; | 1627 designator -= ' '; |
1631 return bit_vector_bit (XBIT_VECTOR (temp), designator) ? !not : not; | 1628 return bit_vector_bit (XBIT_VECTOR (temp), designator) ? !not : not; |
1632 } | 1629 } |
1633 | 1630 |
1634 DEFUN ("check-category-at", Fcheck_category_at, 2, 4, 0, /* | 1631 DEFUN ("check-category-at", Fcheck_category_at, 2, 4, 0, /* |
1635 Return t if category of a character at POS includes DESIGNATOR, | 1632 Return t if category of the character at POSITION includes DESIGNATOR. |
1636 else return nil. Optional third arg specifies which buffer | 1633 Optional third arg BUFFER specifies which buffer to use, and defaults |
1637 \(defaulting to current), and fourth specifies the CATEGORY-TABLE, | 1634 to the current buffer. |
1638 \(defaulting to the buffer's category table). | 1635 Optional fourth arg CATEGORY-TABLE specifies the category table to |
1639 */ | 1636 use, and defaults to BUFFER's category table. |
1640 (pos, designator, buffer, category_table)) | 1637 */ |
1638 (position, designator, buffer, category_table)) | |
1641 { | 1639 { |
1642 Lisp_Object ctbl; | 1640 Lisp_Object ctbl; |
1643 Emchar ch; | 1641 Emchar ch; |
1644 unsigned int des; | 1642 unsigned int des; |
1645 struct buffer *buf = decode_buffer (buffer, 0); | 1643 struct buffer *buf = decode_buffer (buffer, 0); |
1646 | 1644 |
1647 CHECK_INT (pos); | 1645 CHECK_INT (position); |
1648 CHECK_CATEGORY_DESIGNATOR (designator); | 1646 CHECK_CATEGORY_DESIGNATOR (designator); |
1649 des = XCHAR (designator); | 1647 des = XCHAR (designator); |
1650 ctbl = check_category_table (category_table, Vstandard_category_table); | 1648 ctbl = check_category_table (category_table, Vstandard_category_table); |
1651 ch = BUF_FETCH_CHAR (buf, XINT (pos)); | 1649 ch = BUF_FETCH_CHAR (buf, XINT (position)); |
1652 return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil; | 1650 return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil; |
1653 } | 1651 } |
1654 | 1652 |
1655 DEFUN ("char-in-category-p", Fchar_in_category_p, 2, 3, 0, /* | 1653 DEFUN ("char-in-category-p", Fchar_in_category_p, 2, 3, 0, /* |
1656 Return t if category of character CHR includes DESIGNATOR, else nil. | 1654 Return t if category of CHARACTER includes DESIGNATOR, else nil. |
1657 Optional third arg specifies the CATEGORY-TABLE to use, | 1655 Optional third arg CATEGORY-TABLE specifies the category table to use, |
1658 which defaults to the system default table. | 1656 and defaults to the standard category table. |
1659 */ | 1657 */ |
1660 (chr, designator, category_table)) | 1658 (character, designator, category_table)) |
1661 { | 1659 { |
1662 Lisp_Object ctbl; | 1660 Lisp_Object ctbl; |
1663 Emchar ch; | 1661 Emchar ch; |
1664 unsigned int des; | 1662 unsigned int des; |
1665 | 1663 |
1666 CHECK_CATEGORY_DESIGNATOR (designator); | 1664 CHECK_CATEGORY_DESIGNATOR (designator); |
1667 des = XCHAR (designator); | 1665 des = XCHAR (designator); |
1668 CHECK_CHAR (chr); | 1666 CHECK_CHAR (character); |
1669 ch = XCHAR (chr); | 1667 ch = XCHAR (character); |
1670 ctbl = check_category_table (category_table, Vstandard_category_table); | 1668 ctbl = check_category_table (category_table, Vstandard_category_table); |
1671 return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil; | 1669 return check_category_char (ch, ctbl, des, 0) ? Qt : Qnil; |
1672 } | 1670 } |
1673 | 1671 |
1674 DEFUN ("category-table", Fcategory_table, 0, 1, 0, /* | 1672 DEFUN ("category-table", Fcategory_table, 0, 1, 0, /* |
1675 Return the current category table. | 1673 Return BUFFER's current category table. |
1676 This is the one specified by the current buffer, or by BUFFER if it | 1674 BUFFER defaults to the current buffer. |
1677 is non-nil. | |
1678 */ | 1675 */ |
1679 (buffer)) | 1676 (buffer)) |
1680 { | 1677 { |
1681 return decode_buffer (buffer, 0)->category_table; | 1678 return decode_buffer (buffer, 0)->category_table; |
1682 } | 1679 } |
1689 { | 1686 { |
1690 return Vstandard_category_table; | 1687 return Vstandard_category_table; |
1691 } | 1688 } |
1692 | 1689 |
1693 DEFUN ("copy-category-table", Fcopy_category_table, 0, 1, 0, /* | 1690 DEFUN ("copy-category-table", Fcopy_category_table, 0, 1, 0, /* |
1694 Construct a new category table and return it. | 1691 Return a new category table which is a copy of CATEGORY-TABLE. |
1695 It is a copy of the TABLE, which defaults to the standard category table. | 1692 CATEGORY-TABLE defaults to the standard category table. |
1696 */ | 1693 */ |
1697 (table)) | 1694 (category_table)) |
1698 { | 1695 { |
1699 if (NILP (Vstandard_category_table)) | 1696 if (NILP (Vstandard_category_table)) |
1700 return Fmake_char_table (Qcategory); | 1697 return Fmake_char_table (Qcategory); |
1701 | 1698 |
1702 table = check_category_table (table, Vstandard_category_table); | 1699 category_table = |
1703 return Fcopy_char_table (table); | 1700 check_category_table (category_table, Vstandard_category_table); |
1701 return Fcopy_char_table (category_table); | |
1704 } | 1702 } |
1705 | 1703 |
1706 DEFUN ("set-category-table", Fset_category_table, 1, 2, 0, /* | 1704 DEFUN ("set-category-table", Fset_category_table, 1, 2, 0, /* |
1707 Select a new category table for BUFFER. | 1705 Select CATEGORY-TABLE as the new category table for BUFFER. |
1708 One argument, a category table. | |
1709 BUFFER defaults to the current buffer if omitted. | 1706 BUFFER defaults to the current buffer if omitted. |
1710 */ | 1707 */ |
1711 (table, buffer)) | 1708 (category_table, buffer)) |
1712 { | 1709 { |
1713 struct buffer *buf = decode_buffer (buffer, 0); | 1710 struct buffer *buf = decode_buffer (buffer, 0); |
1714 table = check_category_table (table, Qnil); | 1711 category_table = check_category_table (category_table, Qnil); |
1715 buf->category_table = table; | 1712 buf->category_table = category_table; |
1716 /* Indicate that this buffer now has a specified category table. */ | 1713 /* Indicate that this buffer now has a specified category table. */ |
1717 buf->local_var_flags |= XINT (buffer_local_flags.category_table); | 1714 buf->local_var_flags |= XINT (buffer_local_flags.category_table); |
1718 return table; | 1715 return category_table; |
1719 } | 1716 } |
1720 | 1717 |
1721 DEFUN ("category-designator-p", Fcategory_designator_p, 1, 1, 0, /* | 1718 DEFUN ("category-designator-p", Fcategory_designator_p, 1, 1, 0, /* |
1722 Return t if ARG is a category designator (a char in the range ' ' to '~'). | 1719 Return t if OBJECT is a category designator (a char in the range ' ' to '~'). |
1723 */ | 1720 */ |
1724 (obj)) | 1721 (object)) |
1725 { | 1722 { |
1726 return CATEGORY_DESIGNATORP (obj) ? Qt : Qnil; | 1723 return CATEGORY_DESIGNATORP (object) ? Qt : Qnil; |
1727 } | 1724 } |
1728 | 1725 |
1729 DEFUN ("category-table-value-p", Fcategory_table_value_p, 1, 1, 0, /* | 1726 DEFUN ("category-table-value-p", Fcategory_table_value_p, 1, 1, 0, /* |
1730 Return t if ARG is a category table value. | 1727 Return t if OBJECT is a category table value. |
1731 Valid values are nil or a bit vector of size 95. | 1728 Valid values are nil or a bit vector of size 95. |
1732 */ | 1729 */ |
1733 (obj)) | 1730 (object)) |
1734 { | 1731 { |
1735 return CATEGORY_TABLE_VALUEP (obj) ? Qt : Qnil; | 1732 return CATEGORY_TABLE_VALUEP (object) ? Qt : Qnil; |
1736 } | 1733 } |
1737 | 1734 |
1738 | 1735 |
1739 #define CATEGORYP(x) \ | 1736 #define CATEGORYP(x) \ |
1740 (CHARP (x) && XCHAR (x) >= 0x20 && XCHAR (x) <= 0x7E) | 1737 (CHARP (x) && XCHAR (x) >= 0x20 && XCHAR (x) <= 0x7E) |
1880 | 1877 |
1881 Emacs treats a sequence of word constituent characters as a single | 1878 Emacs treats a sequence of word constituent characters as a single |
1882 word (i.e. finds no word boundary between them) iff they belongs to | 1879 word (i.e. finds no word boundary between them) iff they belongs to |
1883 the same charset. But, exceptions are allowed in the following cases. | 1880 the same charset. But, exceptions are allowed in the following cases. |
1884 | 1881 |
1885 (1) The case that characters are in different charsets is controlled | 1882 \(1) The case that characters are in different charsets is controlled |
1886 by the variable `word-combining-categories'. | 1883 by the variable `word-combining-categories'. |
1887 | 1884 |
1888 Emacs finds no word boundary between characters of different charsets | 1885 Emacs finds no word boundary between characters of different charsets |
1889 if they have categories matching some element of this list. | 1886 if they have categories matching some element of this list. |
1890 | 1887 |
1894 | 1891 |
1895 For instance, to tell that ASCII characters and Latin-1 characters can | 1892 For instance, to tell that ASCII characters and Latin-1 characters can |
1896 form a single word, the element `(?l . ?l)' should be in this list | 1893 form a single word, the element `(?l . ?l)' should be in this list |
1897 because both characters have the category `l' (Latin characters). | 1894 because both characters have the category `l' (Latin characters). |
1898 | 1895 |
1899 (2) The case that character are in the same charset is controlled by | 1896 \(2) The case that character are in the same charset is controlled by |
1900 the variable `word-separating-categories'. | 1897 the variable `word-separating-categories'. |
1901 | 1898 |
1902 Emacs find a word boundary between characters of the same charset | 1899 Emacs find a word boundary between characters of the same charset |
1903 if they have categories matching some element of this list. | 1900 if they have categories matching some element of this list. |
1904 | 1901 |