You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the package's user hit a bug. After some debugging it seems that issue is with the advice timp--kill-emacs that timp adds around save-buffers-kill-emacs function.
The restart-emacs package works by starting a new instance of Emacs just before current instance of Emacs is killed, to achieve this a function is added to the kill-emacs-hook which actually starts the new instance.
Obviously the function needs to be added temporarily to kill-emacs-hook, so that it does not interfere with normal Emacs exists. The easiest way to do this is to create a let binding for kill-emacs-hook around the invocation of function save-buffers-kill-emacs, which contains the function that needs to be invoked for launching other Emacs. This way the hook is present only for that invocation and no code is needed to remove it if Emacs exit fails for some reason. I am not sure if I have explained the restart process well enough, let me know if it was not clear.
Now since timp--kill-emacs invokes the function asynchronously (if some thread is running and needs to be stopped) using a timer the dynamic environment setup with the special value of kill-emacs-hook described above is lost and restarting fails.
Perhaps making the wait synchronous would solve the issue, something like the following
Hi,
I am the author of the package
restart-emacs
.One of the package's user hit a bug. After some debugging it seems that issue is with the advice
timp--kill-emacs
thattimp
adds aroundsave-buffers-kill-emacs
function.The restart-emacs package works by starting a new instance of Emacs just before current instance of Emacs is killed, to achieve this a function is added to the
kill-emacs-hook
which actually starts the new instance.Obviously the function needs to be added temporarily to
kill-emacs-hook
, so that it does not interfere with normal Emacs exists. The easiest way to do this is to create alet binding
forkill-emacs-hook
around the invocation of functionsave-buffers-kill-emacs
, which contains the function that needs to be invoked for launching other Emacs. This way the hook is present only for that invocation and no code is needed to remove it if Emacs exit fails for some reason. I am not sure if I have explained the restart process well enough, let me know if it was not clear.Now since
timp--kill-emacs
invokes the function asynchronously (if some thread is running and needs to be stopped) using a timer the dynamic environment setup with the special value ofkill-emacs-hook
described above is lost and restarting fails.Perhaps making the wait synchronous would solve the issue, something like the following
Thanks
The text was updated successfully, but these errors were encountered: