unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55684: 29.0.50; wrong-type-argument in minibuffer-only frames
@ 2022-05-27 20:09 Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-05-28  5:56 ` Eli Zaretskii
  2022-05-28 10:48 ` Alan Mackenzie
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-05-27 20:09 UTC (permalink / raw)
  To: 55684; +Cc: Alan Mackenzie

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);
 






^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-28 14:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 20:09 bug#55684: 29.0.50; wrong-type-argument in minibuffer-only frames Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-28  5:56 ` Eli Zaretskii
2022-05-28 10:51   ` Alan Mackenzie
2022-05-28 10:57     ` Eli Zaretskii
2022-05-28 13:09       ` Alan Mackenzie
2022-05-28 13:18         ` Eli Zaretskii
2022-05-28 10:48 ` Alan Mackenzie
2022-05-28 14:22   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).