1
votes

What is the idiomatic elisp way to have emacs start with N buffers, M windows, and M of those N buffers loaded into windows of a designated placement and size? Or maybe there's a nice plugin for this? Specifically, I want to have an emacs session like this upon startup:

enter image description here

In case version matters, I'm looking to use gnu emacs 24.3.

1
Are you going from terminal (or a file manager such as Finder.app in OSX), such that you want to open a file in a specific window? If so, which window do you want the file to appear in? Or, are you just launching the GUI version without opening a specific file? - lawlist
I'm using Finder.app to open emacs.app. But emacs.app could also be started with command line options via apple's open command, so CLI solutions could apply. - seewalker
With OSX, the function ns-find-file is used when launching Emacs from Finder.app by opening a file -- e.g., Command+Down-Arrow. You can create your own function and use a defalias -- e.g., (defalias 'ns-find-file 'lawlist-ns-find-file). I'll check back tomorrow sometime to see if you still need a solution. If there is a specific window you want the file displayed in, please post a comment or update your question. In two places, I modify ns-find-file to point to my own lawlist-find-file function, which in turn uses a complex display-buffer function that creates certain frames. - lawlist
Here is a link to the setup that I'm using, which includes an example of modifying ns-find-file to launch from Finder.app: stackoverflow.com/a/18371427/2112489 - lawlist

1 Answers

2
votes

One easy way is to use an Emacs desktop (see the Emacs manual, node Saving Emacs Sessions). Position things as you want, then save your setup as a desktop. (But you will need Emacs 24.4 to have the saved desktop include frame and window configurations.)

(If you use Bookmark+ then you can have multiple desktop bookmarks, and flip between them with a key.)

Otherwise, you will need to write some Elisp code to re-create your frames, windows, buffers etc. in your init file.