GNU bug report logs -
#29985
Allow modifier combinations in windmove-default-keybindings
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Thu, 4 Jan 2018 21:49:02 UTC
Severity: wishlist
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#29985: Allow modifier combinations in windmove-default-keybindings
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 29985 <at> debbugs.gnu.org.
--
29985: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29985
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> I propose to support a list of modifiers as an arg of
> ‘windmove-default-keybindings’ to be able to customize it
> with e.g. (windmove-default-keybindings '(meta shift))
Done.
[Message part 3 (message/rfc822, inline)]
I propose to support a list of modifiers as an arg of
‘windmove-default-keybindings’ to be able to customize it
with e.g. (windmove-default-keybindings '(meta shift))
diff --git a/lisp/windmove.el b/lisp/windmove.el
index db77d81..f565068 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -543,16 +543,18 @@ windmove-down
;; probably want to use different bindings in that case.
;;;###autoload
-(defun windmove-default-keybindings (&optional modifier)
+(defun windmove-default-keybindings (&optional modifiers)
"Set up keybindings for `windmove'.
-Keybindings are of the form MODIFIER-{left,right,up,down}.
-Default MODIFIER is `shift'."
+Keybindings are of the form MODIFIERS-{left,right,up,down},
+where MODIFIERS is either a list of modifiers or a single modifier.
+Default value of MODIFIERS is `shift'."
(interactive)
- (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))
+ (unless modifiers (setq modifiers 'shift))
+ (unless (listp modifiers) (setq modifiers (list modifiers)))
+ (global-set-key (vector (append modifiers '(left))) 'windmove-left)
+ (global-set-key (vector (append modifiers '(right))) 'windmove-right)
+ (global-set-key (vector (append modifiers '(up))) 'windmove-up)
+ (global-set-key (vector (append modifiers '(down))) 'windmove-down))
(provide 'windmove)
This bug report was last modified 7 years and 188 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.