aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2018-01-12 00:10:39 +0200
committerJuri Linkov2018-01-12 00:10:39 +0200
commitad283dfb22770e241347a2f9b00241795e5250f4 (patch)
tree6c81f712908c0bfb2b5162753ed3b10fba336702
parente6266cb95ce9ea7e8fdcc1e2298bcb0513416f3e (diff)
downloademacs-ad283dfb22770e241347a2f9b00241795e5250f4.tar.gz
emacs-ad283dfb22770e241347a2f9b00241795e5250f4.zip
* lisp/windmove.el (windmove-default-keybindings): Allow list of modifiers.
(Bug#29985)
-rw-r--r--lisp/windmove.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/windmove.el b/lisp/windmove.el
index db77d810e05..f5650684097 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -543,16 +543,18 @@ If no window is at the desired location, an error is signaled."
543;; probably want to use different bindings in that case. 543;; probably want to use different bindings in that case.
544 544
545;;;###autoload 545;;;###autoload
546(defun windmove-default-keybindings (&optional modifier) 546(defun windmove-default-keybindings (&optional modifiers)
547 "Set up keybindings for `windmove'. 547 "Set up keybindings for `windmove'.
548Keybindings are of the form MODIFIER-{left,right,up,down}. 548Keybindings are of the form MODIFIERS-{left,right,up,down},
549Default MODIFIER is `shift'." 549where MODIFIERS is either a list of modifiers or a single modifier.
550Default value of MODIFIERS is `shift'."
550 (interactive) 551 (interactive)
551 (unless modifier (setq modifier 'shift)) 552 (unless modifiers (setq modifiers 'shift))
552 (global-set-key (vector (list modifier 'left)) 'windmove-left) 553 (unless (listp modifiers) (setq modifiers (list modifiers)))
553 (global-set-key (vector (list modifier 'right)) 'windmove-right) 554 (global-set-key (vector (append modifiers '(left))) 'windmove-left)
554 (global-set-key (vector (list modifier 'up)) 'windmove-up) 555 (global-set-key (vector (append modifiers '(right))) 'windmove-right)
555 (global-set-key (vector (list modifier 'down)) 'windmove-down)) 556 (global-set-key (vector (append modifiers '(up))) 'windmove-up)
557 (global-set-key (vector (append modifiers '(down))) 'windmove-down))
556 558
557 559
558(provide 'windmove) 560(provide 'windmove)