GNU bug report logs - #21833
24.4; desktop-kill, which is interactive, is in kill-emacs-hook

Previous Next

Package: emacs;

Reported by: Michael Arntzenius <daekharel <at> gmail.com>

Date: Wed, 4 Nov 2015 23:09:02 UTC

Severity: minor

Merged with 28943

Found in versions 24.4, 25.2

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 21833 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stelian Iancu <si <at> siancu.net>
Cc: 21833 <at> debbugs.gnu.org, rgm <at> gnu.org
Subject: Re: bug#21833: 24.4;
 desktop-kill, which is interactive, is in kill-emacs-hook
Date: Thu, 12 Nov 2015 22:50:01 +0200
> From: Stelian Iancu <si <at> siancu.net>
> Date: Thu, 12 Nov 2015 21:24:36 +0100
> Cc: 21833 <at> debbugs.gnu.org
> 
> On 12/11/15 21:11, Glenn Morris wrote:
> >
> > The point is that kill-emacs-hook is not supposed to contain interactive
> > things.
> >
> 
> Thanks for the clarification.
> 
> I've had a look at the code and desktop-kill is added to the 
> kill-emacs-hook in desktop.el:
> 
> (unless noninteractive
> (add-hook 'kill-emacs-hook 'desktop-kill))
> 
> So I guess the fix would be to remove these two lines, right?

Not exactly.  From the ELisp manual:

   -- Variable: kill-emacs-hook
       This normal hook is run by `kill-emacs', before it kills Emacs.

       Because `kill-emacs' can be called in situations where user
       interaction is impossible (e.g., when the terminal is
       disconnected), functions on this hook should not attempt to
       interact with the user.  If you want to interact with the user
       when Emacs is shutting down, use `kill-emacs-query-functions',
       described below.

So I think the hook should be added to kill-emacs-query-functions,
since we still want to ask the user that question, when appropriate.




This bug report was last modified 4 years and 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.