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: 23.0.60; Emacs should survive a lost X connection Date: Sun, 10 Feb 2008 17:08:17 -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 1202694124 28656 80.91.229.12 (11 Feb 2008 01:42:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Feb 2008 01:42:04 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, hanche@math.ntnu.no, rms@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 11 02:42:26 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 1JONge-0003bT-Si for ged-emacs-devel@m.gmane.org; Mon, 11 Feb 2008 02:42:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JONgB-0008Er-Oi for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2008 20:41:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JONg6-0008Cz-Sk for emacs-devel@gnu.org; Sun, 10 Feb 2008 20:41:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JONg5-0008BE-86 for emacs-devel@gnu.org; Sun, 10 Feb 2008 20:41:50 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JONg5-0008Au-1X for emacs-devel@gnu.org; Sun, 10 Feb 2008 20:41:49 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JONg4-0002RU-Uj for emacs-devel@gnu.org; Sun, 10 Feb 2008 20:41:49 -0500 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JONg4-0004ba-DQ for emacs-pretest-bug@gnu.org; Sun, 10 Feb 2008 20:41:48 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JONg1-0002R2-Ju for emacs-pretest-bug@gnu.org; Sun, 10 Feb 2008 20:41: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 1JONg1-0002Qw-7Z; Sun, 10 Feb 2008 20:41:45 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAPM2r0dMCpK7/2dsb2JhbABBkU2UWXs X-IronPort-AV: E=Sophos;i="4.25,331,1199682000"; d="scan'208";a="14009864" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 10 Feb 2008 20:41:43 -0500 Original-Received: from ceviche.home ([76.10.146.187]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id RDA29642; Sun, 10 Feb 2008 20:41:42 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 6EAD1B402C; Sun, 10 Feb 2008 17:08:17 -0500 (EST) In-Reply-To: <200802100803.m1A83Eq5026472@sallyv1.ics.uci.edu> (Dan Nicolaescu's message of "Sun, 10 Feb 2008 00:03:11 -0800") 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:88701 gmane.emacs.pretest.bugs:21008 Archived-At: > 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