0

I would like Emacs to open the folder $HOME/Documents/CodeLite/CPP-Math-Projects/Simple-Pendulum on startup and show it in the directory browser. Is there a way to do this? I have read https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html, but it is too abstract for me to follow, given the fact I am fairly unconfident with Emacs Lisp.

3 Answers 3

3

Oops, never mind, I read the link I provided earlier again and I finally got how to turn it into an ~/.emacs modification. Specifically I added:

(setq initial-buffer-choice "~/Documents/CodeLite/CPP-Math-Projects/Simple-Pendulum")

to my ~/.emacs file.

1

If you are on MS Windows, consider using this simple way:

Create a Windows shortcut, with:

  • runemacs.exe (with its path), in field Target. Include any command-line switches you like - e.g., D:\Emacs-25.1\bin\runemacs.exe --debug-init
  • The directory you want Emacs to start in, in field Start in.

You can also have Emacs start out by visiting that directory in Dired. To do that, just add the directory at the end of field Target.

Then, to start Emacs, just double-click your shortcut.

1
  • Na, I use Linux and only Linux. But I know how to create a desktop config file to open emacs to whichever folder I want. I just prefer a config file adjustment. Commented Oct 3, 2016 at 16:12
1

To open a directory at startup you can also insert (find-file "/path/to/dir") in init.el

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.