Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to automatically open a file when Emacs start? I need this to work on Mac OS X and Linux, with GNU Emacs 23.4.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36) or a more recent version. Also, I am using the .app version on Mac.

Edit:

Also, how to let it be opened in a specific window? I want my Emacs to automatically have the frame split vertically and horizontally and therefore have 4 windows. And the file should show up in top left window.

share|improve this question
up vote 2 down vote accepted

Put this at the end of your .emacs file:

(find-file "put the path to your file here")
share|improve this answer
    
To clarify, you keep the double quotes around the path, correct? – iglvzx Mar 14 '12 at 7:02
    
Also, how to let it be opened in a specific window? I want my Emacs to automatically have split vertically and horizontally and have 4 windows. And the file should show up in top left window. – qazwsx Mar 14 '12 at 7:07

well to make a frame horizontal you do C-x-2 which i believe is switch-window-keep-point, so you could add that then add (find file "/")`

share|improve this answer
    
No there is no switch-window-keep-point. I tried. – qazwsx Mar 17 '12 at 16:59
    
sorry its split-window-vertically just type in "C-h-k" then a key binding, then it will give you information about that key binding – Shantanu Mar 20 '12 at 17:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .