Mercurial > emacs
diff lisp/subr.el @ 109194:e0b7f217b35a
Merge from mainline.
author | Katsumi Yamaoka <katsumi@flagship2> |
---|---|
date | Sun, 16 May 2010 00:18:09 +0000 |
parents | cd5442b2826b |
children | fe3c51344472 |
line wrap: on
line diff
--- a/lisp/subr.el Fri May 14 11:34:53 2010 +0000 +++ b/lisp/subr.el Sun May 16 00:18:09 2010 +0000 @@ -3804,5 +3804,30 @@ (prin1-to-string (make-hash-table))))) (provide 'hashtable-print-readable)) +;; Moving with arrows in bidi-sensitive direction. +(defun right-arrow-command (&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-arrow-command ( &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))) + ;; arch-tag: f7e0e6e5-70aa-4897-ae72-7a3511ec40bc ;;; subr.el ends here