emacs-devel
[Top][All Lists]
Advanced

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

Re: 23.0.60; Emacs should survive a lost X connection


From: Stefan Monnier
Subject: Re: 23.0.60; Emacs should survive a lost X connection
Date: Sun, 10 Feb 2008 17:08:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

> emacs -Q -nw -f server-start

> emacsclient -c -d $DISPLAY&

> xkill 
> the emacsclient X11 frame

> then C-x C-c in the emacs -nw frame will warn about clients still being
> connected.

I installed a patch which refines Richard's fix and brings back the
correct "close the client connection" when you close a frame by sending
an X11 "delete" message.  This doesn't solve the above problem because
in that case, the "delete_frame" execution is run at a time where Elisp
cannot be executed.
We need to add some way for Elisp to be informed when frames are
forcefully closed because of something like an `xkill'.  Maybe we just
need to add a `after-delete-terminal-functions', which is run sometime
after deleting a terminal.  Or as suggested by some brilliant mind (at
the end of x_connection_closed):

  /* FIXME: This is an asynchronous interrupt w.r.t elisp, so signalling an
     error might not be the best thing to do.  I'd vote for creating an
     elisp event and stuffing it in the queue so people can bind to it via
     the global map.  --Stef  */

Actually, the global map is probably not a good idea, but the
special-event-map sounds about right for this.

As it turns out, most users of delete-frame-functions really want to
detect a delete-terminal rather than a delete-frame, so maybe we should
think about improving this.  This said, the xt-mouse and
xterm-extra-modifiers need to react to delete-terminal *before* the
conection is closed, rather than after, so we probably need both
a before-delete-terminal-functions (not guaranteed to be run), and some
delete-terminal event (guaranteed to be generated).


        Stefan




reply via email to

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