From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard M Stallman Newsgroups: gmane.emacs.devel Subject: Re: Functions in kill-emacs-hook aren't run if emacs gets killed with SIGTERM Date: Thu, 22 Jan 2009 20:52:50 -0500 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1232675760 1109 80.91.229.12 (23 Jan 2009 01:56:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2009 01:56:00 +0000 (UTC) Cc: eliz@gnu.org, tassilo@member.fsf.org, emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 23 02:57:13 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 1LQBIH-000464-9k for ged-emacs-devel@m.gmane.org; Fri, 23 Jan 2009 02:57:13 +0100 Original-Received: from localhost ([127.0.0.1]:51308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQBGz-0001Jv-V1 for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2009 20:55:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQBFY-0000Yu-Mr for emacs-devel@gnu.org; Thu, 22 Jan 2009 20:54:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQBFW-0000WW-W1 for emacs-devel@gnu.org; Thu, 22 Jan 2009 20:54:24 -0500 Original-Received: from [199.232.76.173] (port=50972 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQBFW-0000WB-Ns for emacs-devel@gnu.org; Thu, 22 Jan 2009 20:54:22 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:48401) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LQBFW-0000Yi-Ek; Thu, 22 Jan 2009 20:54:22 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LQBE2-00068F-BH; Thu, 22 Jan 2009 20:52:50 -0500 In-reply-to: X-detected-operating-system: by monty-python.gnu.org: GNU/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:108123 Archived-At: SIGTERM's handler could run from anywhere, even in code in the interpreter during which interpreter data structures are temporarily inconsistent. So there is no telling what might go wrong if it tries to run kill-emacs-hook. Maybe another option is to first perform the autosaves (like shut_down_emacs does), and then run a hook. This way, no matter what the hook does, no data is lost. I agree that is safer.