I want to insert content from one file anytime a file with a particular name is opened, i have this:
(defun insert-foo-bar(filename)
(when (string= (file-name-nondirectory filename) "foo")
(insert-file-contents "~/bar")))
(add-hook 'find-file-hook 'insert-foo-bar)
However after visiting a file with C-x C-f i get a "wrong number of arguments" error. Can anyone tell me what am I doing wrong?
Thanks
insert-foo-bar
needs one -filename
. Change your question if you want to get an answer with code.