[Top][All Lists]

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

Re: after-delete-terminal-functions

From: Stefan Monnier
Subject: Re: after-delete-terminal-functions
Date: Wed, 13 Feb 2008 17:24:43 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

>     But now I wonder: is DELETE_TERMINAL_EVENT the right thing to do, or
>     should we use run-at-time instead?

> I don't see any reason why run-at-time would work better,
> and it certainly is not cleaner.  It is less clean.

>     So, I removed the `error' call, but this makes things worse, apparently:
>     Emacs then exits abruptly.  It seems that it's important to abort
>     execution at the end of x_connection_closed.  So I re[placed the `error'
>     call by a call to Fthrow.  This finally worked.

> That seems like a plausible approach to me.

> However, another idea is to signal an error and do something special
> so that this error doesn't clear the event.  Even better, the
> top-level loop could queue the event after catching this kind of
> error.

> Or the top-level loop could call the appropriate hook after catching
> this kind of error.  That way there would be no event, just a hook.

> It could distinguish this error based on an error condition symbol.
> That would be clean.

That's an option, indeed.  The problem is that the hook needs to be run
in various circumstances:
- when the terminal is killed explicitly via delete-terminal.
- when the terminal is killed via delete-frame.
- when the terminal is killed from keyboard.c noticing that the `read' fails.
- when the terminal is killed because of the x_io_error.

So it is cleaner to put the "run the hook" in Fdelete_terminal which is
pretty much the common path of all 4.  But sometimes Fdelete_terminal
cannot run elisp, hence the idea of creating an event.

Maybe an alternative is to add a variable `delayed_evals' which would
hold a list of things to run "ASAP".


reply via email to

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