3

I like that at start emacs visits a file with my todo list. For long time, this has been accomplished by adding (find-file "~/my-file.org") at the end of my configuration file (.emacs). However, I found that after installing a new linux distribution (Ubuntu 22.04) emacs is started by default as a daemon. This is ok with me, but I noticed that now the find-file command is ignored.

How can I tell the emacs server to open a file at startup from within the configuration file? If the latter is not good practice, how can I obtain the same result?

1 Answer 1

4

You can use server-after-make-frame-hook:

(add-hook 'server-after-make-frame-hook (lambda () (find-file "~/my-file.org")))

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.