Mercurial > emacs
diff lisp/subr.el @ 108824:8aaae2681a62
Implement bidi-sensitive word movement with arrow keys.
lisp/subr.el (right-arrow-command, left-arrow-command): Move to bindings.el.
lisp/bindings.el (right-char, left-char): Move from subr.el and
rename from right-arrow-command and left-arrow-command.
(right-word, left-word): New functions.
(global-map) <right>: Bind to right-char.
(global-map) <left>: Bind to left-char.
(global-map) <C-right>: Bind to right-word.
(global-map) <C-left>: Bind to left-word.
doc/emacs/basic.texi (Moving Point): Update due to renaming of commands bound
to arrows. Document bidi-aware behavior of C-<right> and C-<left>.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 29 May 2010 18:19:13 +0300 |
parents | fe3c51344472 |
children | 2f74da21b147 |
line wrap: on
line diff
--- a/lisp/subr.el Sat May 29 15:51:01 2010 +0300 +++ b/lisp/subr.el Sat May 29 18:19:13 2010 +0300 @@ -3802,30 +3802,5 @@ (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