4

When I exit emacs via C-x C-c (save-buffers-kill-terminal) it prints a message in minibuffer. I can't read the message because the frame gets destroyed too fast.

I'd like to read the message(s), how can I do this?

2
  • I would suggest inspecting the kill-emacs-hook and the kill-buffer-hook, and the hooks can also be run without killing Emacs by evaluating (run-hooks 'kill-emacs-hook 'kill-buffer-hook), or, you can run just one hook at time ... The write-file-functions hook may also have something interesting attached to it that gets triggered when saving buffers while exiting Emacs.
    – lawlist
    Commented Jun 15, 2017 at 20:50
  • @lawlist thanks again. I did run (run-hooks 'kill-emacs-hook) and then had a look at the Messages buffer. You might write a answer if you like.
    – jue
    Commented Jun 15, 2017 at 21:10

1 Answer 1

3

When killing Emacs, there are several hooks that may end up being called -- including, but not limited to, kill-emacs-hook, kill-buffer-hook (when a buffer is killed), write-file-functions hook (if a buffer is saved). A user can inspect a hook by calling M-x describe-variable and the name of the hook. A user can run a hook by evaluating (run-hooks NAME-OF-HOOK), which function accepts multiple arguments such that several hooks can be called. The original poster has indicated in a comment above that (run-hooks 'kill-emacs-hook) triggered the functions that were of particular interest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.