bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55684: 29.0.50; wrong-type-argument in minibuffer-only frames


From: Stefan Monnier
Subject: bug#55684: 29.0.50; wrong-type-argument in minibuffer-only frames
Date: Fri, 27 May 2022 16:09:13 -0400

Package: Emacs
Version: 29.0.50


    src/emacs -Q --eval '(setq default-frame-alist `((minibuffer . nil)))'

Stays "frozen" because of a wrong-type-argument error in
`Fset_frame_selected_window` on `CHECK_LIVE_WINDOW (window);`.

The patch below seems to "fix" it, but I must admit that I don't really
understand this code (see for example the FIXME comment in the patch).
Does someone know what is the user-level behavior we're trying to
obtain here?

It seems that this comes from Alan's commit dfa3e6f424b20fe27d904.


        Stefan


diff --git a/src/frame.c b/src/frame.c
index 252dc591bfa..dc55004b193 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1576,8 +1576,14 @@ do_switch_frame (Lisp_Object frame, int track, int 
for_deletion, Lisp_Object nor
      to a different window, the most recently used one, unless there is a
      valid active minibuffer in the mini-window.  */
   if (EQ (f->selected_window, f->minibuffer_window)
+         /* FIXME: Can this test ever fail?  I.e. can 'minibuffer_window'
+            ever contain a non-mini-buffer (and if so, should we care here)? */
       && NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt)))
-    Fset_frame_selected_window (frame, call1 (Qget_mru_window, frame), Qnil);
+    {
+      Lisp_Object w = call1 (Qget_mru_window, frame);
+      if (!NILP (w))            /* Can be nil in minibuffer-only frames.  */
+        Fset_frame_selected_window (frame, w, Qnil);
+    }
 
   Fselect_window (f->selected_window, norecord);
 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]