GNU bug report logs -
#65719
[PATCH] Pass restart argument to 'kill-emacs-query-functions'
Previous Next
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
Message #47 received at 65719 <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 04 Jan 2025 13:34:23 +0000
> From: me <at> elken.dev
> Cc: 65719 <at> debbugs.gnu.org, stefankangas <at> gmail.com
>
> > Sorry, I still don't follow. What does your
> > kill-emacs-query-functions hook do when passed the RESTART argument
> > that is different from RESTART being nil (i.e. killing Emacs without
> > restarting it)?
>
> The point is differentiating between a quick "Oh I just need to clear
> out some memory or reset the state of my Emacs, but I want to carry on
> working as I was" and "I'm done with Emacs now, next time I start it I
> want it to be a clean slate". Adding another hook was the cleanest
> option I could come up with.
It's a strange (and maybe even dangerous) distinction.
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.
This bug report was last modified 106 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.