Subject: bug#78997: closed (Re: bug#78997: Fix for windmove-do-window-select erroring on 'no-select)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 19 Jul 2025 08:36:02 +0000

Your bug report

#78997: Fix for windmove-do-window-select erroring on 'no-select

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].

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

Subject: Re: bug#78997: Fix for windmove-do-window-select erroring on 'no-select
From: Eli Zaretskii <[email-masked]>
To: JJ <[email-masked]>
Cc: [email-masked]
Date: Sat, 19 Jul 2025 11:35:48 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Fri, 11 Jul 2025 12:56:58 -0700
> From: JJ <[email-masked]>
> 
> See attached patch and commit message.

Thanks, installed on the master branch, and closing the bug.

Please in the future format the commit log messages of your
contributions according to our conventions (see CONTRIBUTE), because
otherwise "git am" fails, and I need to correct the patch "by hand".

Subject: Fix for windmove-do-window-select erroring on 'no-select
From: JJ <[email-masked]>
To: [email-masked]
Date: Fri, 11 Jul 2025 12:56:58 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

See attached patch and commit message.

From 8e884d855b64f58c59571d52f6ee3210de5a8068 Mon Sep 17 00:00:00 2001
From: JJ <[email-masked]>
Date: Fri, 11 Jul 2025 12:34:35 -0700
Subject: [PATCH] Fix for windmove-do-window-select erroring if other-window is
 'no-select

If the variable windmove-create-window is set to a function that returns 'no-select, windmove-do-window-select is intended to ignore the final window selection.

However, because other-window is passed to window-minibuffer-p before checking if other-window is 'no-select, window-minibuffer-p will instead throw a type error, and the (eq other-window 'no-select) case will never be reached. This patch moves this case up a line to avoid this.
---
 lisp/windmove.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index d69a09f..ed76c67 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -422,10 +422,10 @@ repeated commands."
 
     (cond ((null other-window)
            (user-error "No window %s from selected window" dir))
+          ((eq other-window 'no-select))
           ((and (window-minibuffer-p other-window)
                 (not (minibuffer-window-active-p other-window)))
            (user-error "Minibuffer is inactive"))
-          ((eq other-window 'no-select))
           (t
            (select-window other-window)))))
 
-- 
2.50.0