aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii2013-06-29 16:36:19 +0300
committerEli Zaretskii2013-06-29 16:36:19 +0300
commit4c672a0fec1d18cc1a445acf3e6935d681d4048f (patch)
treec8fb2626c93a226bed5eaa0b92f95925734e893f /doc
parent73b1b3ad6196234984a29298bc66eabf1299de66 (diff)
downloademacs-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/ChangeLog5
-rw-r--r--doc/emacs/basic.texi14
-rw-r--r--doc/emacs/mule.texi4
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/display.texi20
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 @@
12013-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
12013-06-28 Glenn Morris <rgm@gnu.org> 62013-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
156This command (@code{right-char}) behaves like @kbd{C-f}, with one 158This command (@code{right-char}) behaves like @kbd{C-f}, with one
157exception: when editing right-to-left scripts such as Arabic, it 159exception: when editing right-to-left scripts such as Arabic, it
158instead moves @emph{backward} if the current paragraph is a 160instead moves @emph{backward} if the current paragraph is a
159right-to-left paragraph. @xref{Bidirectional Editing}. 161right-to-left paragraph. @xref{Bidirectional Editing}. If
162@code{visual-order-cursor-movement} is non-@code{nil}, this command
163moves to the character that is to the right of the current screen
164position, moving to the next or previous screen line as appropriate.
165Note that this might potentially move point many buffer positions
166away, 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
169This command (@code{left-char}) behaves like @kbd{C-b}, except it 176This command (@code{left-char}) behaves like @kbd{C-b}, except it
170moves @emph{forward} if the current paragraph is right-to-left. 177moves @emph{forward} if the current paragraph is right-to-left.
171@xref{Bidirectional Editing}. 178@xref{Bidirectional Editing}. If @code{visual-order-cursor-movement}
179is non-@code{nil}, this command moves to the character that is to the
180left of the current screen position, moving to the previous or next
181screen 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
1804highlighted region covering a contiguous range of character positions 1804highlighted region covering a contiguous range of character positions
1805may look discontinuous if the region spans reordered text. This is 1805may look discontinuous if the region spans reordered text. This is
1806normal and similar to the behavior of other programs that support 1806normal and similar to the behavior of other programs that support
1807bidirectional text. 1807bidirectional text. If you set @code{visual-order-cursor-movement} to
1808a non-@code{nil} value, cursor motion by the arrow keys follows the
1809visual 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 @@
12013-06-29 Eli Zaretskii <eliz@gnu.org>
2
3 * display.texi (Bidirectional Display): Document move-point-visually.
4
12013-06-29 Xue Fuqiao <xfq.free@gmail.com> 52013-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
6431buffers, this function always returns @code{left-to-right}. 6431buffers, 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,
6436either to the left or to the right of its current screen position.
6437Emacs provides a primitive to do that.
6438
6439@defun move-point-visually direction
6440This function moves point of the currently selected window to the
6441buffer position that appears immediately to the right or to the left
6442of point on the screen. If @var{direction} is positive, point will
6443move one screen position to the right, otherwise it will move one
6444screen position to the left. Note that, depending on the surrounding
6445bidirectional context, this could potentially move point many buffer
6446positions away. If invoked at the end of a screen line, the function
6447moves point to the rightmost or leftmost screen position of the next
6448or previous screen line, as appropriate for the value of
6449@var{direction}.
6450
6451The 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