GNU bug report logs - #78980
31.0.50; C-z crashes emacsclient -nw

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Wed, 9 Jul 2025 13:33:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: 78980 <at> debbugs.gnu.org, Pip Cet <pipcet <at> protonmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#78980: 31.0.50; C-z crashes emacsclient -nw
Date: Thu, 10 Jul 2025 16:55:53 +0200
> The functionality on GUIs sounds like we should have something like
>
>    bool is_displayed(struct frame *f) {
>        // Öeave window system frames alone
>        if (!is_tty_frame(f))
>            return true;
>        // Don't display if not marked visible.
>        if (!FRAME_VISIBLE_P(f))
>            return false;
>        // If marked visible but parent isn't displayed
>        const struct frame *oarent = FRAME_PARENT_FRAME(f);
>        return parent ? is_displayed(parent) : true;
>    }
>
> WDYT?

But that's precisely what frame_redisplay_p is supposed to accomplish.
Look at the patch below which further simplifies what Pip Cet proposed
earlier.

martin


diff --git a/src/frame.c b/src/frame.c
index 70e200d9219..2d88ad94114 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -358,36 +358,27 @@ DEFUN ("window-system", Fwindow_system, Swindow_system, 0, 1, 0,
 }

 /** Return true if F can be redisplayed, that is if F is visible and, if
-    F is a tty frame, all its ancestors are visible too.  */
+    F is a tty frame, all its ancestors are visible too and F's root
+    frame is its terminal's top frame..  */
 bool
 frame_redisplay_p (struct frame *f)
 {
   if (is_tty_frame (f))
     {
-      struct frame *p = FRAME_PARENT_FRAME (f);
-      struct frame *q = NULL;
+      struct tty_display_info *tty = FRAME_TTY (f);
+      struct frame *r = XFRAME (tty->top_frame);

-      while (p)
+      while (f)
 	{
-	  if (!p->visible)
+	  if (!f->visible)
 	    /* A tty child frame cannot be redisplayed if one of its
 	       ancestors is invisible.  */
 	    return false;
 	  else
-	    {
-	      q = p;
-	      p = FRAME_PARENT_FRAME (p);
-	    }
+	    f = FRAME_PARENT_FRAME (f);
 	}

-      struct tty_display_info *tty = FRAME_TTY (f);
-      struct frame *r = XFRAME (tty->top_frame);
-
-      /* A tty child frame can be redisplayed iff its root is the top
-	 frame of its terminal.  Any other tty frame can be redisplayed
-	 iff it is the top frame of its terminal itself which must be
-	 always visible.  */
-      return (q ? q == r : f == r);
+      return f == r;
     }
   else
 #ifndef HAVE_X_WINDOWS

This bug report was last modified 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.