Subject: bug#65719: [PATCH] Pass restart argument to 'kill-emacs-query-functions'

From: Eli Zaretskii <[email-masked]>
Date: Sat, 04 Jan 2025 15:09:17 +0200

> Date: Thu, 02 Jan 2025 14:07:33 +0000
> From: [email-masked]
> Cc: [email-masked], [email-masked]
> 
> On 2024-02-12 17:35, Eli Zaretskii wrote:
> > [Please use Reply All to reply, to keep everybody CC'ed.]
> > 
> >> Date: Mon, 12 Feb 2024 17:21:04 +0000
> >> From: Elken <[email-masked]>
> >> 
> >> The use case that raised it for me was loading perspective workspaces 
> >> when I restart in place (due to a
> >> configuration change or other reason) but I don't want to load the 
> >> workspaces every time I start Emacs.
> > 
> > And why cannot you use kill-emacs-query-functions for this purpose?
> 
> Bumping this patch again as it would be nice to have in. To answer the 
> question more clearly (I thought I did before, my apologies) using 
> kill-emacs-query-functions would technically work but also add another 
> prompt every time I quit or restart. It makes sense to have a clear 
> separation of quitting for good and restarting in place.

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)?  And what does "loading workspaces" mean in this
context?

> I also noticed this morning that `kill-emacs` and `restart-emacs` don't 
> handle the prefix argument for the hooks.

What would these hooks do with the prefix argument?

In any case, the prefix argument is available via current-prefix-arg.