From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#29985: Allow modifier combinations in windmove-default-keybindings Date: Thu, 04 Jan 2018 23:47:36 +0200 Organization: LINKOV.NET Message-ID: <87po6pz47b.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1515102447 1293 195.159.176.226 (4 Jan 2018 21:47:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 4 Jan 2018 21:47:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) To: 29985@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 04 22:47:23 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXDLz-0007jA-E1 for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jan 2018 22:47:11 +0100 Original-Received: from localhost ([::1]:45538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXDNy-0006WJ-IP for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jan 2018 16:49:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXDNq-0006UZ-Qg for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2018 16:49:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXDNm-0008Am-J9 for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2018 16:49:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55641) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXDNm-0008AV-EO for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2018 16:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eXDNm-0002Q6-76 for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2018 16:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jan 2018 21:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29985 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15151025339277 (code B ref -1); Thu, 04 Jan 2018 21:49:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jan 2018 21:48:53 +0000 Original-Received: from localhost ([127.0.0.1]:36087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXDNd-0002PX-CL for submit@debbugs.gnu.org; Thu, 04 Jan 2018 16:48:53 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXDNc-0002PF-3z for submit@debbugs.gnu.org; Thu, 04 Jan 2018 16:48:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXDNW-0007z4-5l for submit@debbugs.gnu.org; Thu, 04 Jan 2018 16:48:46 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51642) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXDNW-0007yp-2T for submit@debbugs.gnu.org; Thu, 04 Jan 2018 16:48:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXDNU-0006Nd-P0 for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2018 16:48:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXDNQ-0007tx-Rn for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2018 16:48:44 -0500 Original-Received: from hapkido.dreamhost.com ([66.33.216.122]:48345) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXDNQ-0007sS-Lw for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2018 16:48:40 -0500 Original-Received: from homiemail-a76.g.dreamhost.com (sub3.mail.dreamhost.com [69.163.253.7]) by hapkido.dreamhost.com (Postfix) with ESMTP id 2FEA28E03B for ; Thu, 4 Jan 2018 13:48:39 -0800 (PST) Original-Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id 33FBA45807B for ; Thu, 4 Jan 2018 13:48:38 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-109-142.cust.tele2.ee [91.129.109.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPSA id 89C85458079 for ; Thu, 4 Jan 2018 13:48:37 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:141785 Archived-At: I propose to support a list of modifiers as an arg of =E2=80=98windmove-default-keybindings=E2=80=99 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. =20 ;;;###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)) =20 =20 (provide 'windmove)