I have got a question about config of emacs startup behavior. I don't have any idea about lisp, I simply love emacs for editing.
What I would like to have is the following:
emacs FILE
FILE
FILE.abc
FILE.xyz
I had a look here: how to create a specific window setup on in .emacs and it's half way through. However, the macro thing doesn't really work in my case because I need to pass an argument. Any help greatly appreciated.
In general, you will find yourself better served by Emacs if you stay in it just "visit" (as Emacs has been - for 40 years - calling the operation elsewhere known - for 30 years - as "open") files.
Here is the function (untested):
(defun open-two-files (file)
"Open FILE.abc in the top window and FILE.xyz in the bottom window.
http://stackoverflow.com/questions/15070481/specifying-emacs-startup-behavior"
(interactive "FEnter file base name: ")
(let ((old-window (selected-window))
(new-window (split-window-below)))
(find-file (concat file ".abc"))
(select-window new-window)
(find-file (concat file ".xyz"))
(select-window old-window)))
You need to put it into your ~/.emacs.el
.
Now, if you have emacs already opened, you need to do M-x open-two-files RET foo RET
to open foo.abc
and foo.xyz
.
If you want to start a new Emacs session, type emacs --eval '(open-two-files "foo")'