diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2002-05-07 16:37:46 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2002-05-07 16:37:46 +0000 |
commit | 125d5ec7081f3b8e47b53f084509d6ce30b16664 (patch) | |
tree | 037b664fc50b94d6dc9ec2973e316ee340408a55 /lisp/windmove.el | |
parent | f194e54a12e89f978fda6f7b12cd66da23067381 (diff) | |
download | emacs-125d5ec7081f3b8e47b53f084509d6ce30b16664.tar.gz |
(windmove-default-keybindings): Add optional parameter to allow using a
modifier other than 'shift.
Diffstat (limited to 'lisp/windmove.el')
-rw-r--r-- | lisp/windmove.el | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/lisp/windmove.el b/lisp/windmove.el index 0320fd0aaef..fc5e864391c 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -98,7 +98,13 @@ ;; ;; Put the following line in your `.emacs' file: ;; -;; (windmove-default-keybindings) ; default keybindings +;; (windmove-default-keybindings) ; shifted arrow keys +;; +;; or +;; +;; (windmove-default-keybindings 'hyper) ; etc. +;; +;; to use another modifier key. ;; ;; ;; If you wish to enable wrap-around, also add a line like: @@ -110,7 +116,7 @@ ;; causes the occasional creation of a "lost column" between windows, ;; so that two adjacent windows do not actually touch, you may want to ;; increase the value of `windmove-window-distance-delta' to 2 or 3: -;; +;; ;; (setq windmove-window-distance-delta 2) ;; @@ -589,13 +595,16 @@ If no window is at the desired location, an error is signaled." ;; probably want to use different bindings in that case. ;;;###autoload -(defun windmove-default-keybindings () - "Set up default keybindings for `windmove'." +(defun windmove-default-keybindings (&optional modifier) + "Set up keybindings for `windmove'. +Keybindings are of the form MODIFIER-{left,right,up,down}. +Default MODIFIER is 'shift." (interactive) - (global-set-key [(shift left)] 'windmove-left) - (global-set-key [(shift up)] 'windmove-up) - (global-set-key [(shift right)] 'windmove-right) - (global-set-key [(shift down)] 'windmove-down)) + (unless modifier (setq modifier 'shift)) + (global-set-key (vector (list modifier 'left)) 'windmove-left) + (global-set-key (vector (list modifier 'right)) 'windmove-right) + (global-set-key (vector (list modifier 'up)) 'windmove-up) + (global-set-key (vector (list modifier 'down)) 'windmove-down)) (provide 'windmove) |