|
From: | Joost Kremers |
Subject: | Re: graceful shutdown of non-interactive Elisp program |
Date: | Sun, 14 Jun 2020 00:59:51 +0200 |
User-agent: | mu4e 1.5.2; emacs 27.0.91 |
On Sat, Jun 13 2020, Paul Pogonyshev wrote:
I'm trying to make a Elisp program that is run in a non-interactive mode, i.e. essentially as `emacs --batch --load myfile.el'. A normal way to shutdown terminal programs is with C-c, which is expected to be "graceful"shutdown, e.g. the program still has a chance to save files etc.However, with Elisp I'm not sure how to achieve that except for constantly modifying `kill-emacs-hook', which would be a nightmare from codingperspective.
What do you mean "constantly modifying `kill-emacs-hook'"? You just add a function to it when your program starts and if it's shut down before Emacs is killed, you remove the function again. Or leave it, if it doesn't do any harm.
-- Joost Kremers Life has its moments
[Prev in Thread] | Current Thread | [Next in Thread] |