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

From: [email-masked]
Date: Sat, 04 Jan 2025 13:34:23 +0000

> 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.

> And what does "loading workspaces" mean in this context?

Maybe I should refer to them as perspectives instead, but this package: 
https://github.com/nex3/perspective-el. An arrangement of buffers and 
frames categorised by some condition (in my case project.el project) so 
each perspective has its own "tab" with all the buffers that belong to 
the perspective and a specific window arrangement. Basically, I want all 
the open buffers and window arrangement remembered.

When I close down Emacs proper, I don't want it to load the exact 
arrangement when I then re-open it next time. However, when I call 
`restart-emacs`, I DO want it to load the previous arrangement of 
buffers, windows and tabs.

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

Yes you're right, I realised after I sent it....