unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Ehud Karni" <ehud@unix.mvs.co.il>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Lisp functions called on Emacs close
Date: Tue, 3 Sep 2002 00:03:21 +0300	[thread overview]
Message-ID: <200209022103.g82L3L026291@beta.mvs.co.il> (raw)
In-Reply-To: <vafvg5py2mj.fsf@crybaby.cs.uni-dortmund.de> (Kai.Grossjohann@CS.Uni-Dortmund.DE)

On Sun, 01 Sep 2002 20:40:52 +0200, Kai.Grossjohann@CS.Uni-Dortmund.DE wrote:
> 
> "Joseph Fannin" <jhf@rivenstone.net writes:
> 
> >     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

  reply	other threads:[~2002-09-02 21:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <pan.2002.09.01.06.52.58.332970@rivenstone.net>
2002-09-01 18:40 ` Lisp functions called on Emacs close Kai Großjohann
2002-09-02 21:03   ` Ehud Karni [this message]
2002-09-01 19:26 ` D. Goel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200209022103.g82L3L026291@beta.mvs.co.il \
    --to=ehud@unix.mvs.co.il \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).