+;; Moving with arrows in bidi-sensitive direction.
+(defun right-char (&optional n)
+ "Move point N characters to the right (to the left if N is negative).
+On reaching beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, this may move either forward
+or backward in the buffer. This is in contrast with \\[forward-char]
+and \\[backward-char], which see."
+ (interactive "^p")
+ (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+ (forward-char n)
+ (backward-char n)))
+
+(defun left-char ( &optional n)
+ "Move point N characters to the left (to the right if N is negative).
+On reaching beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, this may move either backward
+or forward in the buffer. This is in contrast with \\[backward-char]
+and \\[forward-char], which see."
+ (interactive "^p")
+ (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+ (backward-char n)
+ (forward-char n)))
+
+(defun right-word (&optional n)
+ "Move point N words to the right (to the left if N is negative).
+
+Depending on the bidirectional context, this may move either forward
+or backward in the buffer. This is in contrast with \\[forward-word]
+and \\[backward-word], which see.
+
+Value is normally t.
+If an edge of the buffer or a field boundary is reached, point is left there
+there and the function returns nil. Field boundaries are not noticed
+if `inhibit-field-text-motion' is non-nil."
+ (interactive "^p")
+ (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+ (forward-word n)
+ (backward-word n)))
+
+(defun left-word (&optional n)
+ "Move point N words to the left (to the right if N is negative).
+
+Depending on the bidirectional context, this may move either backward
+or forward in the buffer. This is in contrast with \\[backward-word]
+and \\[forward-word], which see.
+
+Value is normally t.
+If an edge of the buffer or a field boundary is reached, point is left there
+there and the function returns nil. Field boundaries are not noticed
+if `inhibit-field-text-motion' is non-nil."
+ (interactive "^p")
+ (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+ (backward-word n)
+ (forward-word n)))
+