GNU bug report logs - #65719
[PATCH] Pass restart argument to 'kill-emacs-query-functions'

Previous Next

Package: emacs;

Reported by: me <at> elken.dev

Date: Sun, 3 Sep 2023 19:29:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#65719: closed ([PATCH] Pass restart argument to
 'kill-emacs-query-functions')
Date: Sat, 01 Feb 2025 12:06:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 01 Feb 2025 14:05:38 +0200
with message-id <86bjvlg99p.fsf <at> gnu.org>
and subject line Re: bug#65719: [PATCH] Pass restart argument to 'kill-emacs-query-functions'
has caused the debbugs.gnu.org bug report #65719,
regarding [PATCH] Pass restart argument to 'kill-emacs-query-functions'
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
65719: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65719
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: me <at> elken.dev
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Pass restart argument to 'kill-emacs-query-functions'
Date: Sun, 03 Sep 2023 20:28:34 +0100
[Message part 3 (text/plain, inline)]
Hi all,

Small change here to pass the restart status to 
'kill-emacs-query-functions' in 'save-buffers-kill-emacs' so any 
functions there can react to being restarted, sample use-case this may 
be useful is if one is using a package like perspective.el to handle 
buffer/window management and when calling `M-x restart-emacs` you WANT 
your last session to be persisted, but just starting Emacs normally you 
don't.

There are other potential use-cases for this too, so hopefully this 
patch is well-received.

Thanks all,

Ellis (@lkn)
[0001-Add-restart-argument-to-kill-emacs-query-functions.patch (text/x-diff, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: me <at> elken.dev
Cc: 65719-done <at> debbugs.gnu.org, stefankangas <at> gmail.com
Subject: Re: bug#65719: [PATCH] Pass restart argument to
 'kill-emacs-query-functions'
Date: Sat, 01 Feb 2025 14:05:38 +0200
> Cc: 65719 <at> debbugs.gnu.org, stefankangas <at> gmail.com
> Date: Tue, 07 Jan 2025 18:38:04 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > Date: Tue, 07 Jan 2025 15:54:42 +0000
> > From: me <at> elken.dev
> > Cc: 65719 <at> debbugs.gnu.org, stefankangas <at> gmail.com
> > 
> > > It's a strange (and maybe even dangerous) distinction.
> > 
> > I'm afraid I don't see this, could you elaborate?
> > 
> > > But in any case, I think a cleaner solution would be to bind a
> > > variable inside restart-emacs, and then your hook could examine it.
> > > Alternatively, ...
> > > 
> > >> > In any case, the prefix argument is available via current-prefix-arg.
> > >> 
> > >> Yes you're right, I realised after I sent it....
> > > 
> > > ...you could invoke restart-emacs with a prefix argument, and examine
> > > that in your kill-emacs-query-functions hook.  AFAICT, this should
> > > work without any changes.
> > 
> > I'm afraid I also don't follow here, how is that cleaner than 
> > introducing
> > a specific hook? Rather than needing to specifically modify a function
> > to work with the prefix argument, you can just add it to the hook.
> 
> It isn't necessarily cleaner, but it is a local solution for what I
> consider a local and very specialized problem.  There's no reason to
> expect Emacs to have an OOTB solution for every possible niche use
> case that some user needs to handle.  Adding a hook means we all have
> to pay the price in documenting it, maintaining it, etc.
> 
> Each request for adding a new feature should have a solid enough basis
> before we must consider it for addition.  FWIW, I don't yet see why
> this particular request qualifies.

No further comments, so I'm closing this bug.


This bug report was last modified 134 days ago.

Previous Next


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