diff options
| author | Eli Zaretskii | 2010-03-29 08:26:24 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2010-03-29 08:26:24 -0400 |
| commit | f4b6ba46b857e140c6482c0542c70fc989b1fe85 (patch) | |
| tree | e11b18a23b3a1ef8cfd0f535fec388d2fb3184a1 /doc | |
| parent | c0546589ab9573047bb0d6cb82e27fe29221b71a (diff) | |
| download | emacs-f4b6ba46b857e140c6482c0542c70fc989b1fe85.tar.gz emacs-f4b6ba46b857e140c6482c0542c70fc989b1fe85.zip | |
Support MS-Windows build and reversed rows in GUI frames; add initial docs.
doc/emacs/mule.texi (International): Mention support of
bidirectional editing.
(Bidirectional Editing): New section.
etc/HELLO: Reorder Arabic and Hebrew into logical order, and
insert RLM before the opening paren, to make the display more
reasonable. Add setting for bidi-display-reordering in the local
variables section.
lisp/files.el: Make bidi-display-reordering safe variable for
boolean values.
src/xdisp (append_glyph): If the glyph row is reversed, prepend the
glyph rather than appending it.
src/makefile.w32-in (OBJ1): Add $(BLD)/bidi.$(O).
($(BLD)/bidi.$(O)): New target.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/mule.texi | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 00aa9047aec..6420132e0ce 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi | |||
| @@ -67,6 +67,12 @@ incorrectly, refer to @ref{Undisplayable Characters}, which describes | |||
| 67 | possible problems and explains how to solve them. | 67 | possible problems and explains how to solve them. |
| 68 | 68 | ||
| 69 | @item | 69 | @item |
| 70 | Characters from scripts whose natural ordering of text is from right | ||
| 71 | to left are reordered for display (@pxref{Bidirectional Editing}). | ||
| 72 | These scripts include Arabic, Hebrew, Syriac, Thaana, and a few | ||
| 73 | others. | ||
| 74 | |||
| 75 | @item | ||
| 70 | You can insert non-@acronym{ASCII} characters or search for them. To do that, | 76 | You can insert non-@acronym{ASCII} characters or search for them. To do that, |
| 71 | you can specify an input method (@pxref{Select Input Method}) suitable | 77 | you can specify an input method (@pxref{Select Input Method}) suitable |
| 72 | for your language, or use the default input method set up when you set | 78 | for your language, or use the default input method set up when you set |
| @@ -107,6 +113,7 @@ to make sure Emacs interprets keyboard input correctly; see | |||
| 107 | * Unibyte Mode:: You can pick one European character set | 113 | * Unibyte Mode:: You can pick one European character set |
| 108 | to use without multibyte characters. | 114 | to use without multibyte characters. |
| 109 | * Charsets:: How Emacs groups its internal character codes. | 115 | * Charsets:: How Emacs groups its internal character codes. |
| 116 | * Bidirectional Editing:: Support for right-to-left scripts. | ||
| 110 | @end menu | 117 | @end menu |
| 111 | 118 | ||
| 112 | @node International Chars | 119 | @node International Chars |
| @@ -1653,6 +1660,84 @@ older Emacs versions. | |||
| 1653 | point before it and type @kbd{C-u C-x =} (@pxref{International | 1660 | point before it and type @kbd{C-u C-x =} (@pxref{International |
| 1654 | Chars}). | 1661 | Chars}). |
| 1655 | 1662 | ||
| 1663 | @node Bidirectional Editing | ||
| 1664 | @section Bidirectional Editing | ||
| 1665 | @cindex bidirectional editing | ||
| 1666 | @cindex right-to-left text | ||
| 1667 | |||
| 1668 | Emacs supports editing text written in scripts, such as Arabic and | ||
| 1669 | Hebrew, whose natural ordering of horizontal text for display is from | ||
| 1670 | right to left. However, digits and Latin text embedded in these | ||
| 1671 | scripts are still displayed left to right. It is also not uncommon to | ||
| 1672 | have small portions of text in Arabic or Hebrew embedded in otherwise | ||
| 1673 | Latin document, e.g., as comments and strings in a program source | ||
| 1674 | file. For these reasons, text that uses these scripts is actually | ||
| 1675 | @dfn{bidirectional}: a mixture of runs of left-to-right and | ||
| 1676 | right-to-left characters. | ||
| 1677 | |||
| 1678 | This section describes the facilities and options provided by Emacs | ||
| 1679 | for editing bidirectional text. | ||
| 1680 | |||
| 1681 | @cindex logical order | ||
| 1682 | @cindex visual order | ||
| 1683 | Emacs stores right-to-left and bidirectional text in the so-called | ||
| 1684 | @dfn{logical} (or @dfn{reading}) order: the buffer or string position | ||
| 1685 | of the first character you read precedes that of the next character. | ||
| 1686 | Reordering of bidirectional text into the @dfn{visual} order happens | ||
| 1687 | at display time. As result, character positions no longer increase | ||
| 1688 | monotonically with their positions on display. Emacs implements the | ||
| 1689 | Unicode Bidirectional Algorithm described in the Unicode Standard | ||
| 1690 | Annex #9, for reordering of bidirectional text for display. | ||
| 1691 | |||
| 1692 | @vindex bidi-display-reordering | ||
| 1693 | The buffer-local variable @code{bidi-display-reordering} controls | ||
| 1694 | whether text in the buffer is reordered for display. If its value is | ||
| 1695 | non-@code{nil}, Emacs reorders characters that have right-to-left | ||
| 1696 | directionality when they are displayed. The default value is | ||
| 1697 | @code{nil}. | ||
| 1698 | |||
| 1699 | Each paragraph of bidirectional text can have its own @dfn{base | ||
| 1700 | direction}, either right-to-left or left-to-right. (Paragraph | ||
| 1701 | boundaries are defined by the regular expressions | ||
| 1702 | @code{paragraph-start} and @code{paragraph-separate}, see | ||
| 1703 | @ref{Paragraphs}.) Text in left-to-right paragraphs begins at the | ||
| 1704 | left margin of the window and is truncated or continued when it | ||
| 1705 | reaches the right margin. By contrast, text in right-to-left | ||
| 1706 | paragraphs begins at the right margin and is continued or truncated at | ||
| 1707 | the left margin. | ||
| 1708 | |||
| 1709 | @vindex bidi-paragraph-direction | ||
| 1710 | Emacs determines the base direction of each paragraph dynamically, | ||
| 1711 | based on the text at the beginning of the paragraph. However, | ||
| 1712 | sometimes a buffer may need to force a certain base direction for its | ||
| 1713 | paragraphs. The variable @code{bidi-paragraph-direction}, if | ||
| 1714 | non-@code{nil}, disables the dynamic determination of the base | ||
| 1715 | direction, and instead forces all paragraphs in the buffer to have the | ||
| 1716 | direction specified by its buffer-local value. The value can be either | ||
| 1717 | @code{right-to-left} or @code{left-to-right}. Any other value is | ||
| 1718 | interpreted as @code{nil}. | ||
| 1719 | |||
| 1720 | @cindex LRM | ||
| 1721 | @cindex RLM | ||
| 1722 | Alternatively, you can control the base direction of a paragraph by | ||
| 1723 | inserting special formatting characters in front of the paragraph. | ||
| 1724 | The special character @code{RIGHT-TO-LEFT MARK}, or @sc{rlm}, forces | ||
| 1725 | the right-to-left direction on the following paragraph, while | ||
| 1726 | @code{LEFT-TO-RIGHT MARK}, or @sc{lrm} forces the left-to-right | ||
| 1727 | direction. (You can use @kbd{C-x 8 RET} to insert these characters.) | ||
| 1728 | In a GUI session, the @sc{lrm} and @sc{rlm} characters display as | ||
| 1729 | blanks. | ||
| 1730 | |||
| 1731 | Because characters are reordered for display, Emacs commands that | ||
| 1732 | operate in the logical order or on stretches of buffer positions may | ||
| 1733 | produce unusual effects. For example, @kbd{C-f} and @kbd{C-b} | ||
| 1734 | commands move point in the logical order, so the cursor will sometimes | ||
| 1735 | jump when point traverses reordered bidirectional text. Similarly, a | ||
| 1736 | highlighted region covering a contiguous range of character positions | ||
| 1737 | may look discontinuous if the region spans reordered text. This is | ||
| 1738 | normal and similar to behavior of other programs that support | ||
| 1739 | bidirectional text. | ||
| 1740 | |||
| 1656 | @ignore | 1741 | @ignore |
| 1657 | arch-tag: 310ba60d-31ef-4ce7-91f1-f282dd57b6b3 | 1742 | arch-tag: 310ba60d-31ef-4ce7-91f1-f282dd57b6b3 |
| 1658 | @end ignore | 1743 | @end ignore |