From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM Date: Wed, 04 Feb 2009 22:34:38 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1233804913 11173 80.91.229.12 (5 Feb 2009 03:35:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Feb 2009 03:35:13 +0000 (UTC) Cc: tassilo@member.fsf.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 05 04:36:28 2009 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 1LUv2O-0003xp-0U for ged-emacs-devel@m.gmane.org; Thu, 05 Feb 2009 04:36:24 +0100 Original-Received: from localhost ([127.0.0.1]:57299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUv14-0008Ls-Q0 for ged-emacs-devel@m.gmane.org; Wed, 04 Feb 2009 22:35:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LUv0z-0008Je-DH for emacs-devel@gnu.org; Wed, 04 Feb 2009 22:34:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LUv0v-0008JJ-UG for emacs-devel@gnu.org; Wed, 04 Feb 2009 22:34:56 -0500 Original-Received: from [199.232.76.173] (port=60307 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUv0v-0008JG-Ms for emacs-devel@gnu.org; Wed, 04 Feb 2009 22:34:53 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:64302 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LUv0t-00037l-UC; Wed, 04 Feb 2009 22:34:52 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsIEAPfsiUlFxIvi/2dsb2JhbACBbs5EhBYGgwI X-IronPort-AV: E=Sophos;i="4.37,382,1231131600"; d="scan'208";a="33350573" Original-Received: from 69-196-139-226.dsl.teksavvy.com (HELO ceviche.home) ([69.196.139.226]) by ironport2-out.teksavvy.com with ESMTP; 04 Feb 2009 22:34:44 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id D9584B400C; Wed, 4 Feb 2009 22:34:38 -0500 (EST) In-Reply-To: (Eli Zaretskii's message of "Mon, 02 Feb 2009 22:23:24 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:108767 Archived-At: >> > We may also delay it indefinitely if we run Lisp, because that could >> > infloop, especially if our internal data structures are unstable. >> What makes you think our data structures might be unstable when we >> get SIGTERM? > Because of what you yourself wrote: >> AFAIK this signal is only received when some external process >> decides that Emacs should stop > An external process can decide that Emacs should stop whenever it > wants to, and Emacs could be in the middle of GC, for example. But as I said repeatedly in this thread it's irrelevant, because in order for it to run kill-emacs-hook, this signal should not be handed from its signal handler but from the usual input handling, just like SIGUSRn. So data-structures should be just fine. >> > If SIGTERM is used to programmatically shut down Emacs, I think it's >> > rather a conceptual bug in whatever uses SIGTERM for that purpose. >> Huh? SIGTERM is *the canonical way* to programmatically shut down an >> application via a signal. >> From _outside_ Emacs, yes. Which isn't the case here. > Anyway, Dan suggested a better way long ago, so it's IMO pointless to > continue this argument. No, it's an alternative solution to "how do I kill the daemon". I still think that sending the SIGTERM signal should run kill-emacs-hook, regardless. Stefan