]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix for 'windmove-do-window-select' if other-window is 'no-select
authorgit@toki.la <git@toki.la>
Fri, 11 Jul 2025 19:34:35 +0000 (12:34 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 25 Jul 2025 08:07:56 +0000 (10:07 +0200)
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 (windmove-do-window-select): Check for
'no-select' value earlier.  (Bug#78997)

Copyright-paperwork-exempt: yes
(cherry picked from commit 256dfdf11f40d94a86490d1b68bb86935e2d3f03)

lisp/windmove.el

index 6e670e6c0aabbd39b8d42c6e341b03675b3e858a..0878233213169258b7fe6b878be40766d973c82f 100644 (file)
@@ -357,10 +357,10 @@ in direction DIR instead."
                            (split-window window nil dir))))
     (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)))))