Subject: bug#60161: closed (Re: bug#60161: [PATCH] Allow customising windmove user options with an empty prefix)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 18 Dec 2022 11:47:02 +0000

Your bug report

#60161: [PATCH] Allow customising windmove user options with an empty prefix

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 [email-masked].

-- 
60161: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60161
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#60161: [PATCH] Allow customising windmove user options with an empty prefix
From: Philip Kaludercic <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked]
Date: Sun, 18 Dec 2022 11:46:29 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> writes:

>> From: Philip Kaludercic <[email-masked]>
>> Date: Sat, 17 Dec 2022 15:04:41 +0000
>> 
>> I just switched to setopt, and noticed a few errors.  Among these was
>> `windmove-default-keybindings', which didn't want to set
>> 
>>   (setopt windmove-default-keybindings '(nil . nil))
>> 
>> while
>> 
>>   (setopt windmove-default-keybindings '("C-c" . nil))
>> 
>> is allowed.  The mistake appears to be that the option type is
>> misconfigured, and believes the car must be a keybinding, which hasn't
>> been the case since Emacs 28.  The patch below updates the type,
>> resolving this issue.
>
> Thanks, please install on the release branch.

Pushed

Subject: [PATCH] Allow customising windmove user options with an empty prefix
From: Philip Kaludercic <[email-masked]>
To: [email-masked]
Date: Sat, 17 Dec 2022 15:04:41 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

I just switched to setopt, and noticed a few errors.  Among these was
`windmove-default-keybindings', which didn't want to set

  (setopt windmove-default-keybindings '(nil . nil))

while

  (setopt windmove-default-keybindings '("C-c" . nil))

is allowed.  The mistake appears to be that the option type is
misconfigured, and believes the car must be a keybinding, which hasn't
been the case since Emacs 28.  The patch below updates the type,
resolving this issue.

In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.16.0) of 2022-12-14 built on quetzal
Repository revision: 622838b957e240d700585050e9ddbd036e690513
Repository branch: emacs-29
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure --with-pgtk --with-imagemagick'

>From feca8985392c227ee7caaaa69ac8bdc990a0256b Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <[email-masked]>
Date: Sat, 17 Dec 2022 15:54:40 +0100
Subject: [PATCH] Allow customising windmove user options with an empty prefix

* lisp/windmove.el (windmove--default-keybindings-type): Handle nil
as a prefix value.
---
 lisp/windmove.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index 00e76df0a0..4311f082de 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -776,7 +776,8 @@ windmove-swap-states-default-keybindings
 (defconst windmove--default-keybindings-type
   `(choice (const :tag "Don't bind" nil)
            (cons :tag "Bind using"
-                 (key-sequence :tag "Prefix")
+                 (choice (key-sequence :tag "Prefix")
+                         (const :tag "No Prefix" nil))
                  (set :tag "Modifier"
                       :greedy t
                       ;; See `(elisp) Keyboard Events'
-- 
2.35.1