Closed raxod502 closed 3 years ago
Hi @raxod502, thanks for the PR and the detailed explanation. I was wondering if this is better suited as a separate command rather than a variable. I think it is convenient from the user's perspective to have a separate command which the user can invoke without having to set a variable, thoughts?
That seems reasonable. What do you think of making the user option a private variable, and introducing a new command that will bind it to non-nil around calling restart-emacs
?
Alternatively, I could try factoring out some of the logic of restart-emacs
into a utility function and then implement two separate commands (for restarting and starting a new session) which would use that utility function in order to reduce the amount of code duplication.
I think the first approach, a private variable with a helper command to which binds to to non-nil while calling restart-emacs
, would work for now
The latest commit should implement the desired functionality, thanks for the feedback. Let me know if updates to changelog or tests are desired as well.
Updated the README as well.
Thanks a lot @raxod502
I frequently use restart-emacs when testing modifications to my Emacs configuration. However, restarting is not always the best way to test changes, because if the changes are broken, then I no longer have a working Emacs session with which to fix them. It's better if I can start a new session to see if the changes work, before killing the original session if desired.
This PR implements a new user option
restart-emacs-inhibit-kill-p
which, if non-nil, tweaks the behavior of therestart-emacs
function to start a new session instead of performing a restart. I have been using this feature for a few years viael-patch
but figured it might be desired upstream.Please let me know if additional changes or information are needed.