I'm looking to run some code every time Emacs creates a buffer. Is there a hook for this? Something with a name like after-make-buffer-functions
?
Edit: If anyone wants to know what I wanted this for, you can read the relevant portion of my Emacs config here: https://github.com/DarwinAwardWinner/dotemacs/blob/master/site-lisp/settings/tempbuf-settings.el
Basically, I want tempbuf-mode to be enabled in all buffers with certain major modes. So Lindydancer's answer is actually more appropriate than what I was originally looking for.
I know that I could already enable tempbuf-mode in specific modes by adding the tempbuf mode hook to all of those major mode hooks, but I wanted to make it editable through M-x customize
, and this was the easiest way.