From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.help Subject: Re: Lisp functions called on Emacs close Date: Tue, 3 Sep 2002 00:03:21 +0300 Organization: Mivtach-Simon Insurance agencies Sender: help-gnu-emacs-admin@gnu.org Message-ID: <200209022103.g82L3L026291@beta.mvs.co.il> References: Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8 Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1031000615 21282 127.0.0.1 (2 Sep 2002 21:03:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 2 Sep 2002 21:03:35 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17lyM9-0005X2-00 for ; Mon, 02 Sep 2002 23:03:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17lyNf-0001Ay-00; Mon, 02 Sep 2002 17:05:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17lyNS-00019t-00 for help-gnu-emacs@gnu.org; Mon, 02 Sep 2002 17:04:54 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17lyNP-00018l-00 for help-gnu-emacs@gnu.org; Mon, 02 Sep 2002 17:04:53 -0400 Original-Received: from unix.simonwiesel.co.il ([192.114.178.12] helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.10) id 17lyNP-00018Q-00 for help-gnu-emacs@gnu.org; Mon, 02 Sep 2002 17:04:51 -0400 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.11.6/8.11.6) with ESMTP id g82L4nh31495; Tue, 3 Sep 2002 00:04:49 +0300 Original-Received: (from ehud@localhost) by beta.mvs.co.il (8.11.6/8.11.6) id g82L3L026291; Tue, 3 Sep 2002 00:03:21 +0300 Original-To: Kai.Grossjohann@CS.Uni-Dortmund.DE In-Reply-To: (Kai.Grossjohann@CS.Uni-Dortmund.DE) X-Mailer: Emacs 21.1.1 rmail (send-msg 1.106) Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:974 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:974 On Sun, 01 Sep 2002 20:40:52 +0200, Kai.Grossjohann@CS.Uni-Dortmund.DE wrote: > > "Joseph Fannin" > > Can anyone point me to which lisp functions are called when emacs is > > closed? Specifically, I'd like to know which functions are called when > > the window manager's close button is pressed. > > Whee. Not sure. There is kill-emacs-hook and there is > kill-emacs-query-functions. I don't know whether they are executed > in that case, though. The hook `kill-emacs-query-functions' is surely called when using any way to kill emacs willingly (C-x C-c, M-x save-buffers-kill-emacs, close by the window manager), but not by M-x kill-emacs. I have this function to warn me, and it saved me several times. (defun kill-warn () (interactive) (or (boundp 'NO-kill-warn) ;; define this to disable warning (yes-or-no-p "Stop editing and kill all buffers ?"))) (add-hook 'kill-emacs-query-functions 'kill-warn) Ehud. -- Ehud Karni Tel: +972-3-7966-561 /"\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ mailto:ehud@unix.mvs.co.il Better Safe Than Sorry