diff options
author | Eli Zaretskii <eliz@gnu.org> | 2010-05-29 18:19:13 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2010-05-29 18:19:13 +0300 |
commit | db5dce9dd18461205d9320bb705648fe44df328b (patch) | |
tree | 2513c57935d0c244d00af98febe702e41b40ab23 /lisp/subr.el | |
parent | 06fa4a23522821fc3a4e93c7ca505bae4d4733de (diff) | |
download | emacs-db5dce9dd18461205d9320bb705648fe44df328b.tar.gz |
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>.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index fb84f95c805..beb6672a7e1 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3802,30 +3802,5 @@ which is higher than \"1alpha\"." (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 |