From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: after-delete-terminal-functions Date: Wed, 13 Feb 2008 17:24:43 -0500 Message-ID: References: <20080205.155847.56398348.hanche@math.ntnu.no> <200802051957.m15Jv8r1019258@sallyv1.ics.uci.edu> <200802052349.m15NnxSu013983@sallyv1.ics.uci.edu> <200802062007.m16K7r78005498@sallyv1.ics.uci.edu> <200802080726.m187Q5gL002961@sallyv1.ics.uci.edu> <200802090504.m1954WTM028192@sallyv1.ics.uci.edu> <200802100803.m1A83Eq5026472@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1202941508 12660 80.91.229.12 (13 Feb 2008 22:25:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Feb 2008 22:25:08 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, dann@ics.uci.edu, hanche@math.ntnu.no To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 13 23:25:31 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JPQ2k-0005XX-AC for ged-emacs-devel@m.gmane.org; Wed, 13 Feb 2008 23:25:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JPQ2G-0000sD-HL for ged-emacs-devel@m.gmane.org; Wed, 13 Feb 2008 17:25:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JPQ26-0000p7-II for emacs-devel@gnu.org; Wed, 13 Feb 2008 17:24:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JPQ24-0000oE-Tn for emacs-devel@gnu.org; Wed, 13 Feb 2008 17:24:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JPQ24-0000o9-J7 for emacs-devel@gnu.org; Wed, 13 Feb 2008 17:24:48 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JPQ24-0002un-Gu for emacs-devel@gnu.org; Wed, 13 Feb 2008 17:24:48 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JPQ24-0000b6-0Y for emacs-pretest-bug@gnu.org; Wed, 13 Feb 2008 17:24:48 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JPQ21-0002tp-6J for emacs-pretest-bug@gnu.org; Wed, 13 Feb 2008 17:24:48 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JPQ20-0002tb-Pl; Wed, 13 Feb 2008 17:24:45 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAJT8skdMCrf4/2dsb2JhbACuRX8 X-IronPort-AV: E=Sophos;i="4.25,348,1199682000"; d="scan'208";a="14461055" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 13 Feb 2008 17:24:43 -0500 Original-Received: from pastel.home ([76.10.183.248]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id TYL64843; Wed, 13 Feb 2008 17:24:43 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 3BB6C828E; Wed, 13 Feb 2008 17:24:43 -0500 (EST) In-Reply-To: (Richard Stallman's message of "Wed, 13 Feb 2008 17:00:57 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:88993 gmane.emacs.pretest.bugs:21070 Archived-At: > 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". Stefan