emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two questions about atexit cleanup in dynamic modules


From: Joris Vankerschaver
Subject: Re: Two questions about atexit cleanup in dynamic modules
Date: Mon, 10 Apr 2017 18:36:05 +0100

Dear Philipp,

Many thanks for the confirmation regarding atexit, and for pointing out the kill-emacs-hook. This is exactly what I needed!

With best wishes,
Joris

On Sat, Apr 8, 2017 at 5:38 PM, Philipp Stephani <address@hidden> wrote:


Joris Vankerschaver <address@hidden> schrieb am Fr., 7. Apr. 2017 um 10:52 Uhr:
Hi all,

I wrote a small Emacs dynamic module to execute Python scripts in an embedded
Python interpreter (https://github.com/jvkersch/emacs-python). The main thing
missing is that I would like to do some cleanup in the embedded Python
interpreter when Emacs exits (close open files, deal with threads/processes,
etc). What would be the best way to do so?

1. Can I just register an atexit handler when my module starts, or will that
interfere with some Emacs internals?

Unless you attempt to call Emacs functions in the atexit handler, that should be fine.
 

2. Would it make sense to add support to the module API for a cleanup callback
that is called when Emacs exits?

You can already use the hook `kill-emacs-hook' as usual. That's especially useful if your cleanup needs to interact with Emacs. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]