GNU bug report logs - #29985
Allow modifier combinations in windmove-default-keybindings

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29985 in the body.
You can then email your comments to 29985 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#29985; Package emacs. (Thu, 04 Jan 2018 21:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 04 Jan 2018 21:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Allow modifier combinations in windmove-default-keybindings
Date: Thu, 04 Jan 2018 23:47:36 +0200
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)




Reply sent to Juri Linkov <juri <at> linkov.net>:
You have taken responsibility. (Thu, 11 Jan 2018 22:12:01 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> linkov.net>:
bug acknowledged by developer. (Thu, 11 Jan 2018 22:12:02 GMT) Full text and rfc822 format available.

Message #10 received at 29985-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 29985-done <at> debbugs.gnu.org
Subject: Re: bug#29985: Allow modifier combinations in
 windmove-default-keybindings
Date: Fri, 12 Jan 2018 00:10:59 +0200
> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 09 Feb 2018 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.