emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#29985: closed (Allow modifier combinations in wind


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#29985: closed (Allow modifier combinations in windmove-default-keybindings)
Date: Thu, 11 Jan 2018 22:12:01 +0000

Your message dated Fri, 12 Jan 2018 00:10:59 +0200
with message-id <address@hidden>
and subject line Re: bug#29985: Allow modifier combinations in 
windmove-default-keybindings
has caused the debbugs.gnu.org bug report #29985,
regarding Allow modifier combinations in windmove-default-keybindings
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
29985: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29985
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Allow modifier combinations in windmove-default-keybindings Date: Thu, 04 Jan 2018 23:47:36 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
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)



--- End Message ---
--- Begin Message --- Subject: Re: bug#29985: Allow modifier combinations in windmove-default-keybindings Date: Fri, 12 Jan 2018 00:10:59 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
> 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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]