A newbie question and probably very bingable (had to use that word once :-)), but as I gather thats both ok for SO : How can you get files to open automatically when starting emacs?
I guess it sth. like executing the find file
command in your .emacs
but the exact notation isn't clear to me.
Use Ctrl-x f to open a file from within Emacs. Create a new file in the same way as opening a file by specifying the new filename. The new file will not be saved unless specified. Save a file that is currently open by entering the Ctrl-x Ctrl-s command.
To create a new file, use Control-X-Control-F, just as if the file already existed. When emacs asks you for the file name, type in the name you want your new file to have, and emacs will create the file, and display an empty buffer for you to type in. Emacs will perform file name completion for you.
When Emacs is opened from Windows Explorer, a link or cmd console it uses C:\Users\<USER>\AppData\Roaming\. emacs profile file but if you open Emacs from PowerShell console, Emacs will look for . emacs file in C:\Users\<USER> folder.
C-h b
This opens the help showing the correspondence between key-bindings and elisp functions. Look for
C-x C-f
in it (you can do it by typing C-s C - x space C - f
), you find find-file
. Now, do
C-h f find-file
and it tells you, among other things, the syntax :
(find-file FILENAME &optional WILDCARDS)
So just try
(find-file "/path/to/your/file")
in your .emacs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With