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