Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.