New answers tagged


You could use a directory-local variable. Relevant documentation node. To use this, you create a file .dir-locals.el in the root of each project dir with contents like: ((nil . ((my/is-local . t)))) Then in your config you need to do two things, you need to set the variable as safe so Emacs doesn't prompt you about it whenever it loads a file in that ...


Have a look at the autoinsert package which will do much of what you want although maybe not all.


Define a function that inserts the boilerplate code you want, at the buffer position you want. Put that function on a relevant hook. For #2, one of these might be a relevant hook: window-configuration-change-hook - used when you change buffers write-file-hooks - used when you write a file to disk find-file-hook - used when you visit a file A major mode ...

Top 50 recent answers are included