aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii2010-03-29 08:26:24 -0400
committerEli Zaretskii2010-03-29 08:26:24 -0400
commitf4b6ba46b857e140c6482c0542c70fc989b1fe85 (patch)
treee11b18a23b3a1ef8cfd0f535fec388d2fb3184a1 /doc
parentc0546589ab9573047bb0d6cb82e27fe29221b71a (diff)
downloademacs-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.texi85
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
67possible problems and explains how to solve them. 67possible problems and explains how to solve them.
68 68
69@item 69@item
70Characters from scripts whose natural ordering of text is from right
71to left are reordered for display (@pxref{Bidirectional Editing}).
72These scripts include Arabic, Hebrew, Syriac, Thaana, and a few
73others.
74
75@item
70You can insert non-@acronym{ASCII} characters or search for them. To do that, 76You can insert non-@acronym{ASCII} characters or search for them. To do that,
71you can specify an input method (@pxref{Select Input Method}) suitable 77you can specify an input method (@pxref{Select Input Method}) suitable
72for your language, or use the default input method set up when you set 78for 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.
1653point before it and type @kbd{C-u C-x =} (@pxref{International 1660point before it and type @kbd{C-u C-x =} (@pxref{International
1654Chars}). 1661Chars}).
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
1669Hebrew, whose natural ordering of horizontal text for display is from
1670right to left. However, digits and Latin text embedded in these
1671scripts are still displayed left to right. It is also not uncommon to
1672have small portions of text in Arabic or Hebrew embedded in otherwise
1673Latin document, e.g., as comments and strings in a program source
1674file. For these reasons, text that uses these scripts is actually
1675@dfn{bidirectional}: a mixture of runs of left-to-right and
1676right-to-left characters.
1677
1678 This section describes the facilities and options provided by Emacs
1679for 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
1685of the first character you read precedes that of the next character.
1686Reordering of bidirectional text into the @dfn{visual} order happens
1687at display time. As result, character positions no longer increase
1688monotonically with their positions on display. Emacs implements the
1689Unicode Bidirectional Algorithm described in the Unicode Standard
1690Annex #9, for reordering of bidirectional text for display.
1691
1692@vindex bidi-display-reordering
1693 The buffer-local variable @code{bidi-display-reordering} controls
1694whether text in the buffer is reordered for display. If its value is
1695non-@code{nil}, Emacs reorders characters that have right-to-left
1696directionality when they are displayed. The default value is
1697@code{nil}.
1698
1699 Each paragraph of bidirectional text can have its own @dfn{base
1700direction}, either right-to-left or left-to-right. (Paragraph
1701boundaries 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
1704left margin of the window and is truncated or continued when it
1705reaches the right margin. By contrast, text in right-to-left
1706paragraphs begins at the right margin and is continued or truncated at
1707the left margin.
1708
1709@vindex bidi-paragraph-direction
1710 Emacs determines the base direction of each paragraph dynamically,
1711based on the text at the beginning of the paragraph. However,
1712sometimes a buffer may need to force a certain base direction for its
1713paragraphs. The variable @code{bidi-paragraph-direction}, if
1714non-@code{nil}, disables the dynamic determination of the base
1715direction, and instead forces all paragraphs in the buffer to have the
1716direction 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
1718interpreted as @code{nil}.
1719
1720@cindex LRM
1721@cindex RLM
1722 Alternatively, you can control the base direction of a paragraph by
1723inserting special formatting characters in front of the paragraph.
1724The special character @code{RIGHT-TO-LEFT MARK}, or @sc{rlm}, forces
1725the right-to-left direction on the following paragraph, while
1726@code{LEFT-TO-RIGHT MARK}, or @sc{lrm} forces the left-to-right
1727direction. (You can use @kbd{C-x 8 RET} to insert these characters.)
1728In a GUI session, the @sc{lrm} and @sc{rlm} characters display as
1729blanks.
1730
1731 Because characters are reordered for display, Emacs commands that
1732operate in the logical order or on stretches of buffer positions may
1733produce unusual effects. For example, @kbd{C-f} and @kbd{C-b}
1734commands move point in the logical order, so the cursor will sometimes
1735jump when point traverses reordered bidirectional text. Similarly, a
1736highlighted region covering a contiguous range of character positions
1737may look discontinuous if the region spans reordered text. This is
1738normal and similar to behavior of other programs that support
1739bidirectional 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