delete-frame-functions

delete-frame-functions is a variable defined in `C source code'.
Its value is
nil

  • This variable may be risky if used as a file-local variable.

Documentation:
Functions run before deleting a frame.
The functions are run with one arg, the frame to be deleted.
See `delete-frame'.

Note that functions in this list may be called just before the frame is
actually deleted, or some time later (or even both when an earlier function
in `delete-frame-functions' (indirectly) calls `delete-frame'
recursively).