Mercurial > emacs
comparison src/composite.c @ 98369:690a23ccfcf9
(Fcomposition_get_gstring, Fcompose_region_internal, Fcompose_string_internal)
(Ffind_composition_internal): Doc fix.
(syms_of_composite) <compose-chars-after-function>: Doc fix.
(syms_of_composite) <auto-composition-function>: Doc fix.
(syms_of_composite) <composition-function-table>: Doc fix.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 27 Sep 2008 13:10:04 +0000 |
parents | 5803b1114219 |
children | ef372a9c4197 |
comparison
equal
deleted
inserted
replaced
98368:ab98984490b6 | 98369:690a23ccfcf9 |
---|---|
1450 } | 1450 } |
1451 | 1451 |
1452 DEFUN ("composition-get-gstring", Fcomposition_get_gstring, | 1452 DEFUN ("composition-get-gstring", Fcomposition_get_gstring, |
1453 Scomposition_get_gstring, 4, 4, 0, | 1453 Scomposition_get_gstring, 4, 4, 0, |
1454 doc: /* Return a glyph-string for characters between FROM and TO. | 1454 doc: /* Return a glyph-string for characters between FROM and TO. |
1455 If the glhph string is for graphic display, FONT-OBJECT must be | 1455 If the glyph string is for graphic display, FONT-OBJECT must be |
1456 a font-object to use for those characters. | 1456 a font-object to use for those characters. |
1457 Otherwise (for terminal display), FONT-OBJECT must be nil. | 1457 Otherwise (for terminal display), FONT-OBJECT must be nil. |
1458 | 1458 |
1459 If the optional 4th argument STRING is not nil, it is a string | 1459 If the optional 4th argument STRING is not nil, it is a string |
1460 containing the target characters between indices FROM and TO. | 1460 containing the target characters between indices FROM and TO. |
1461 | 1461 |
1462 A glhph-string is a vector containing information about how to display | 1462 A glyph-string is a vector containing information about how to display |
1463 specific character sequence. The format is: | 1463 a specific character sequence. The format is: |
1464 [HEADER ID GLYPH ...] | 1464 [HEADER ID GLYPH ...] |
1465 | 1465 |
1466 HEADER is a vector of this form: | 1466 HEADER is a vector of this form: |
1467 [FONT-OBJECT CHAR ...] | 1467 [FONT-OBJECT CHAR ...] |
1468 where | 1468 where |
1471 CHARs are characters to be composed by GLYPHs. | 1471 CHARs are characters to be composed by GLYPHs. |
1472 | 1472 |
1473 ID is an identification number of the glyph-string. It may be nil if | 1473 ID is an identification number of the glyph-string. It may be nil if |
1474 not yet shaped. | 1474 not yet shaped. |
1475 | 1475 |
1476 GLYPH is a vector whose elements has this form: | 1476 GLYPH is a vector whose elements have this form: |
1477 [ FROM-IDX TO-IDX C CODE WIDTH LBEARING RBEARING ASCENT DESCENT | 1477 [ FROM-IDX TO-IDX C CODE WIDTH LBEARING RBEARING ASCENT DESCENT |
1478 [ [X-OFF Y-OFF WADJUST] | nil] ] | 1478 [ [X-OFF Y-OFF WADJUST] | nil] ] |
1479 where | 1479 where |
1480 FROM-IDX and TO-IDX are used internally and should not be touched. | 1480 FROM-IDX and TO-IDX are used internally and should not be touched. |
1481 C is the character of the glyph. | 1481 C is the character of the glyph. |
1482 CODE is the glyph-code of C in FONT-OBJECT. | 1482 CODE is the glyph-code of C in FONT-OBJECT. |
1483 WIDTH thru DESCENT are the metrics (in pixels) of the glyph. | 1483 WIDTH thru DESCENT are the metrics (in pixels) of the glyph. |
1484 X-OFF and Y-OFF are offests to the base position for the glyph. | 1484 X-OFF and Y-OFF are offsets to the base position for the glyph. |
1485 WADJUST is the adjustment to the normal width of the glyph. | 1485 WADJUST is the adjustment to the normal width of the glyph. |
1486 | 1486 |
1487 If GLYPH is nil, the remaining elements of the glhph-string vector | 1487 If GLYPH is nil, the remaining elements of the glyph-string vector |
1488 must be ignore. */) | 1488 should be ignored. */) |
1489 (from, to, font_object, string) | 1489 (from, to, font_object, string) |
1490 Lisp_Object font_object, from, to, string; | 1490 Lisp_Object font_object, from, to, string; |
1491 { | 1491 { |
1492 Lisp_Object gstring, header; | 1492 Lisp_Object gstring, header; |
1493 EMACS_INT frompos, topos; | 1493 EMACS_INT frompos, topos; |
1518 Scompose_region_internal, 2, 4, 0, | 1518 Scompose_region_internal, 2, 4, 0, |
1519 doc: /* Internal use only. | 1519 doc: /* Internal use only. |
1520 | 1520 |
1521 Compose text in the region between START and END. | 1521 Compose text in the region between START and END. |
1522 Optional 3rd and 4th arguments are COMPONENTS and MODIFICATION-FUNC | 1522 Optional 3rd and 4th arguments are COMPONENTS and MODIFICATION-FUNC |
1523 for the composition. See `compose-region' for more detail. */) | 1523 for the composition. See `compose-region' for more details. */) |
1524 (start, end, components, modification_func) | 1524 (start, end, components, modification_func) |
1525 Lisp_Object start, end, components, modification_func; | 1525 Lisp_Object start, end, components, modification_func; |
1526 { | 1526 { |
1527 validate_region (&start, &end); | 1527 validate_region (&start, &end); |
1528 if (!NILP (components) | 1528 if (!NILP (components) |
1539 Scompose_string_internal, 3, 5, 0, | 1539 Scompose_string_internal, 3, 5, 0, |
1540 doc: /* Internal use only. | 1540 doc: /* Internal use only. |
1541 | 1541 |
1542 Compose text between indices START and END of STRING. | 1542 Compose text between indices START and END of STRING. |
1543 Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC | 1543 Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC |
1544 for the composition. See `compose-string' for more detail. */) | 1544 for the composition. See `compose-string' for more details. */) |
1545 (string, start, end, components, modification_func) | 1545 (string, start, end, components, modification_func) |
1546 Lisp_Object string, start, end, components, modification_func; | 1546 Lisp_Object string, start, end, components, modification_func; |
1547 { | 1547 { |
1548 CHECK_STRING (string); | 1548 CHECK_STRING (string); |
1549 CHECK_NUMBER (start); | 1549 CHECK_NUMBER (start); |
1561 DEFUN ("find-composition-internal", Ffind_composition_internal, | 1561 DEFUN ("find-composition-internal", Ffind_composition_internal, |
1562 Sfind_composition_internal, 4, 4, 0, | 1562 Sfind_composition_internal, 4, 4, 0, |
1563 doc: /* Internal use only. | 1563 doc: /* Internal use only. |
1564 | 1564 |
1565 Return information about composition at or nearest to position POS. | 1565 Return information about composition at or nearest to position POS. |
1566 See `find-composition' for more detail. */) | 1566 See `find-composition' for more details. */) |
1567 (pos, limit, string, detail_p) | 1567 (pos, limit, string, detail_p) |
1568 Lisp_Object pos, limit, string, detail_p; | 1568 Lisp_Object pos, limit, string, detail_p; |
1569 { | 1569 { |
1570 Lisp_Object prop, tail, gstring; | 1570 Lisp_Object prop, tail, gstring; |
1571 EMACS_INT start, end, from, to; | 1571 EMACS_INT start, end, from, to; |
1704 = Fcons (Fcons (Qcomposition, Qt), Vtext_property_default_nonsticky); | 1704 = Fcons (Fcons (Qcomposition, Qt), Vtext_property_default_nonsticky); |
1705 | 1705 |
1706 DEFVAR_LISP ("compose-chars-after-function", &Vcompose_chars_after_function, | 1706 DEFVAR_LISP ("compose-chars-after-function", &Vcompose_chars_after_function, |
1707 doc: /* Function to adjust composition of buffer text. | 1707 doc: /* Function to adjust composition of buffer text. |
1708 | 1708 |
1709 The function is called with three arguments FROM, TO, and OBJECT. | 1709 This function is called with three arguments: FROM, TO, and OBJECT. |
1710 FROM and TO specify the range of text of which composition should be | 1710 FROM and TO specify the range of text whose composition should be |
1711 adjusted. OBJECT, if non-nil, is a string that contains the text. | 1711 adjusted. OBJECT, if non-nil, is a string that contains the text. |
1712 | 1712 |
1713 This function is called after a text with `composition' property is | 1713 This function is called after a text with `composition' property is |
1714 inserted or deleted to keep `composition' property of buffer text | 1714 inserted or deleted to keep `composition' property of buffer text |
1715 valid. | 1715 valid. |
1723 Qauto_composition_function = intern ("auto-composition-function"); | 1723 Qauto_composition_function = intern ("auto-composition-function"); |
1724 staticpro (&Qauto_composition_function); | 1724 staticpro (&Qauto_composition_function); |
1725 | 1725 |
1726 DEFVAR_LISP ("auto-composition-function", &Vauto_composition_function, | 1726 DEFVAR_LISP ("auto-composition-function", &Vauto_composition_function, |
1727 doc: /* Function to call to compose characters automatically. | 1727 doc: /* Function to call to compose characters automatically. |
1728 The function is called from the display routine with four arguments, | 1728 This function is called from the display routine with four arguments: |
1729 FROM, TO, WINDOW, and STRING. | 1729 FROM, TO, WINDOW, and STRING. |
1730 | 1730 |
1731 If STRING is nil, the function must compose characters in the region | 1731 If STRING is nil, the function must compose characters in the region |
1732 between FROM and TO in the current buffer. | 1732 between FROM and TO in the current buffer. |
1733 | 1733 |
1735 string. In this case, the function must compose characters in the | 1735 string. In this case, the function must compose characters in the |
1736 string. */); | 1736 string. */); |
1737 Vauto_composition_function = Qnil; | 1737 Vauto_composition_function = Qnil; |
1738 | 1738 |
1739 DEFVAR_LISP ("composition-function-table", &Vcomposition_function_table, | 1739 DEFVAR_LISP ("composition-function-table", &Vcomposition_function_table, |
1740 doc: /* Char-able of functions for automatic character composition. | 1740 doc: /* Char-table of functions for automatic character composition. |
1741 For each character that has to be composed automatically with | 1741 For each character that has to be composed automatically with |
1742 preceding and/or following characters, this char-table contains | 1742 preceding and/or following characters, this char-table contains |
1743 a function to call to compose that character. | 1743 a function to call to compose that character. |
1744 | 1744 |
1745 The element at index C in the table, if non-nil, is a list of | 1745 The element at index C in the table, if non-nil, is a list of |
1746 this form: ([PATTERN PREV-CHARS FUNC] ...) | 1746 this form: ([PATTERN PREV-CHARS FUNC] ...) |
1747 | 1747 |
1748 PATTERN is a regular expression with which C and the surrounding | 1748 PATTERN is a regular expression which C and the surrounding |
1749 characters must match. | 1749 characters must match. |
1750 | 1750 |
1751 PREV-CHARS is a number of characters before C to check the | 1751 PREV-CHARS is a number of characters before C to check the |
1752 matching with PATTERN. If it is 0, PATTERN must match with C and | 1752 matching with PATTERN. If it is 0, PATTERN must match C and |
1753 the following characters. If it is 1, PATTERN must match with a | 1753 the following characters. If it is 1, PATTERN must match a |
1754 character before C and the following characters. | 1754 character before C and the following characters. |
1755 | 1755 |
1756 If PREV-CHARS is 0, PATTERN can be nil, which means that the | 1756 If PREV-CHARS is 0, PATTERN can be nil, which means that the |
1757 single character C should be composed. | 1757 single character C should be composed. |
1758 | 1758 |
1759 FUNC is a function to return a glyph-string representing a | 1759 FUNC is a function to return a glyph-string representing a |
1760 composition of the characters matching with PATTERN. It is | 1760 composition of the characters that match PATTERN. It is |
1761 called with one argument GSTRING. | 1761 called with one argument GSTRING. |
1762 | 1762 |
1763 GSTRING is a template of a glyph-string to return. It is already | 1763 GSTRING is a template of a glyph-string to return. It is already |
1764 filled with a proper header for the characters to compose, and | 1764 filled with a proper header for the characters to compose, and |
1765 glyphs corresponding to those characters one by one. The | 1765 glyphs corresponding to those characters one by one. The |
1766 function must return a new glyph-string of the same header as | 1766 function must return a new glyph-string with the same header as |
1767 GSTRING, or modify GSTRING itself and return it. | 1767 GSTRING, or modify GSTRING itself and return it. |
1768 | 1768 |
1769 See also the documentation of `auto-composition-mode'. */); | 1769 See also the documentation of `auto-composition-mode'. */); |
1770 Vcomposition_function_table = Fmake_char_table (Qnil, Qnil); | 1770 Vcomposition_function_table = Fmake_char_table (Qnil, Qnil); |
1771 | 1771 |