Subject: bug#13864: 24.3.50; emacsclient -t loops when connected to emacs server running in X11

From: [email-masked] (Ashish SHUKLA)
Date: Wed, 10 Apr 2013 14:36:40 +0530

Hi Eli,

First of all sorry for the delay in reply.

On Tue, 02 Apr 2013 20:10:16 +0300, Eli Zaretskii <[email-masked]> said:
>> From: [email-masked] (Ashish SHUKLA)
>> Cc: [email-masked]
>> Date: Mon, 01 Apr 2013 22:15:46 +0530
>> 
>> Please refer to the attached output.

> Thanks, I think we've finally nailed this sucker.

Seems like you nailed indeed :-)

>> I'm not sure if it's for the right frame (i.e. "garbaged" flag
>> monitored for X11 frame, or emacsclient frame).

> It is certainly for the right frame, because the code that sets the
> "garbaged" flag is here:

>   if (FRAME_TERMCAP_P (XFRAME (frame)) || FRAME_MSDOS_P (XFRAME (frame)))
>     {
>       if (FRAMEP (FRAME_TTY (XFRAME (frame))->top_frame))
> 	/* Mark previously displayed frame as now obscured.  */
> 	SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (XFRAME (frame))->top_frame), 2);
>       SET_FRAME_VISIBLE (XFRAME (frame), 1);  <<<<<<<<<<<<<<<<<<<<<<<<<<<
>       FRAME_TTY (XFRAME (frame))->top_frame = frame;
>     }

> As you can see from the condition for this block, it is only run for
> TTY (a.k.a. "termcap") frames.

> I think the problem here is that the code sets the "garbaged" flag
> even if the "top frame" of the TTY did not change at all.

> Can you try the patch below?  Please try it both with a single TTY
> frame on the xterm (in addition to a GUI frame), like what you did
> until now, and also with several TTY frames on the same xterm (you can
> create additional frames by "C-x 5" commands).

> If this gives good results, I will install it.  Thanks.

I've applied the diff over r112178 (which is what I'd checked out), and I
don't experience this issue any more with Emacs (with all the combinations
you've mentioned above).

Thanks!
-- 
Ashish SHUKLA

“Beware of altruism. It is based on self-deception, the root of all evil.”
(Robert A. Heinlein, 1973)

Sent from my Emacs