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?

jue
  • 4,476
  • 8
  • 20
  • 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 Jun 15 '17 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 Jun 15 '17 at 21:10

1 Answers1

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.

lawlist
  • 18,826
  • 5
  • 37
  • 118