diff options
| author | Eli Zaretskii | 2013-06-29 16:36:19 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-06-29 16:36:19 +0300 |
| commit | 4c672a0fec1d18cc1a445acf3e6935d681d4048f (patch) | |
| tree | c8fb2626c93a226bed5eaa0b92f95925734e893f /doc | |
| parent | 73b1b3ad6196234984a29298bc66eabf1299de66 (diff) | |
| download | emacs-4c672a0fec1d18cc1a445acf3e6935d681d4048f.tar.gz emacs-4c672a0fec1d18cc1a445acf3e6935d681d4048f.zip | |
Implement visual-order cursor motion.
src/xdisp.c (Fmove_point_visually): New function.
lisp/bindings.el (visual-order-cursor-movement): New defcustom.
(right-char, left-char): Provide visual-order cursor motion by
calling move-point-visually. Update the doc strings.
doc/emacs/basic.texi (Moving Point): Document visual-order-cursor-movement
and its effect on right-char and left-char.
doc/lispref/display.texi (Bidirectional Display): Document move-point-visually.
etc/NEWS: Document the new feature.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/emacs/basic.texi | 14 | ||||
| -rw-r--r-- | doc/emacs/mule.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 20 |
5 files changed, 44 insertions, 3 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 45f08499215..d5f3095908b 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-06-29 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * basic.texi (Moving Point): Document visual-order-cursor-movement | ||
| 4 | and its effect on right-char and left-char. | ||
| 5 | |||
| 1 | 2013-06-28 Glenn Morris <rgm@gnu.org> | 6 | 2013-06-28 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * ack.texi (Acknowledgments): Small update. | 8 | * ack.texi (Acknowledgments): Small update. |
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index b9bc391d1cf..a840f912656 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi | |||
| @@ -153,10 +153,17 @@ Move forward one character (@code{forward-char}). | |||
| 153 | @item @key{right} | 153 | @item @key{right} |
| 154 | @kindex RIGHT | 154 | @kindex RIGHT |
| 155 | @findex right-char | 155 | @findex right-char |
| 156 | @vindex visual-order-cursor-movement | ||
| 157 | @cindex cursor, visual-order motion | ||
| 156 | This command (@code{right-char}) behaves like @kbd{C-f}, with one | 158 | This command (@code{right-char}) behaves like @kbd{C-f}, with one |
| 157 | exception: when editing right-to-left scripts such as Arabic, it | 159 | exception: when editing right-to-left scripts such as Arabic, it |
| 158 | instead moves @emph{backward} if the current paragraph is a | 160 | instead moves @emph{backward} if the current paragraph is a |
| 159 | right-to-left paragraph. @xref{Bidirectional Editing}. | 161 | right-to-left paragraph. @xref{Bidirectional Editing}. If |
| 162 | @code{visual-order-cursor-movement} is non-@code{nil}, this command | ||
| 163 | moves to the character that is to the right of the current screen | ||
| 164 | position, moving to the next or previous screen line as appropriate. | ||
| 165 | Note that this might potentially move point many buffer positions | ||
| 166 | away, depending on the surrounding bidirectional context. | ||
| 160 | 167 | ||
| 161 | @item C-b | 168 | @item C-b |
| 162 | @kindex C-b | 169 | @kindex C-b |
| @@ -168,7 +175,10 @@ Move backward one character (@code{backward-char}). | |||
| 168 | @findex left-char | 175 | @findex left-char |
| 169 | This command (@code{left-char}) behaves like @kbd{C-b}, except it | 176 | This command (@code{left-char}) behaves like @kbd{C-b}, except it |
| 170 | moves @emph{forward} if the current paragraph is right-to-left. | 177 | moves @emph{forward} if the current paragraph is right-to-left. |
| 171 | @xref{Bidirectional Editing}. | 178 | @xref{Bidirectional Editing}. If @code{visual-order-cursor-movement} |
| 179 | is non-@code{nil}, this command moves to the character that is to the | ||
| 180 | left of the current screen position, moving to the previous or next | ||
| 181 | screen line as appropriate. | ||
| 172 | 182 | ||
| 173 | @item C-n | 183 | @item C-n |
| 174 | @itemx @key{down} | 184 | @itemx @key{down} |
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index de3e05777cd..c8bd5027fa0 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi | |||
| @@ -1804,4 +1804,6 @@ jump when point traverses reordered bidirectional text. Similarly, a | |||
| 1804 | highlighted region covering a contiguous range of character positions | 1804 | highlighted region covering a contiguous range of character positions |
| 1805 | may look discontinuous if the region spans reordered text. This is | 1805 | may look discontinuous if the region spans reordered text. This is |
| 1806 | normal and similar to the behavior of other programs that support | 1806 | normal and similar to the behavior of other programs that support |
| 1807 | bidirectional text. | 1807 | bidirectional text. If you set @code{visual-order-cursor-movement} to |
| 1808 | a non-@code{nil} value, cursor motion by the arrow keys follows the | ||
| 1809 | visual order on screen (@pxref{Moving Point, visual-order movement}). | ||
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 199d94585e3..dc0c1564735 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-06-29 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * display.texi (Bidirectional Display): Document move-point-visually. | ||
| 4 | |||
| 1 | 2013-06-29 Xue Fuqiao <xfq.free@gmail.com> | 5 | 2013-06-29 Xue Fuqiao <xfq.free@gmail.com> |
| 2 | 6 | ||
| 3 | * buffers.texi (Buffer File Name): Fix typo. | 7 | * buffers.texi (Buffer File Name): Fix typo. |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index d82b9a4c5a2..ecefb684ee6 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -6431,6 +6431,26 @@ determined dynamically by Emacs. For buffers whose value of | |||
| 6431 | buffers, this function always returns @code{left-to-right}. | 6431 | buffers, this function always returns @code{left-to-right}. |
| 6432 | @end defun | 6432 | @end defun |
| 6433 | 6433 | ||
| 6434 | @cindex visual-order cursor motion | ||
| 6435 | Sometimes there's a need to move point in strict visual order, | ||
| 6436 | either to the left or to the right of its current screen position. | ||
| 6437 | Emacs provides a primitive to do that. | ||
| 6438 | |||
| 6439 | @defun move-point-visually direction | ||
| 6440 | This function moves point of the currently selected window to the | ||
| 6441 | buffer position that appears immediately to the right or to the left | ||
| 6442 | of point on the screen. If @var{direction} is positive, point will | ||
| 6443 | move one screen position to the right, otherwise it will move one | ||
| 6444 | screen position to the left. Note that, depending on the surrounding | ||
| 6445 | bidirectional context, this could potentially move point many buffer | ||
| 6446 | positions away. If invoked at the end of a screen line, the function | ||
| 6447 | moves point to the rightmost or leftmost screen position of the next | ||
| 6448 | or previous screen line, as appropriate for the value of | ||
| 6449 | @var{direction}. | ||
| 6450 | |||
| 6451 | The function returns the new buffer position as its value. | ||
| 6452 | @end defun | ||
| 6453 | |||
| 6434 | @cindex layout on display, and bidirectional text | 6454 | @cindex layout on display, and bidirectional text |
| 6435 | @cindex jumbled display of bidirectional text | 6455 | @cindex jumbled display of bidirectional text |
| 6436 | @cindex concatenating bidirectional strings | 6456 | @cindex concatenating bidirectional strings |