tags:

views:

292

answers:

4

I have setup my windows in a certain way. How do I save this setting to be invoked later?

+3  A: 

Here is a link to a script in EMACS Lisp that stores your current layout and saves it: http://www.emacswiki.org/emacs-en/layout-restore.el

Hawkcannon
+1  A: 

Check out emacs desktop. I have no emacs available but I believe it's part of the standard lisp packages you get when you install emacs.

Use the desktop library to save the state of Emacs from one session to another. Once you save the Emacs desktop—the buffers, their file names, major modes, buffer positions, and so on—then subsequent Emacs sessions reload the saved desktop.

Nifle
+1  A: 

Window configurations can be stored in registers.

arvixx
+1  A: 

I sometimes still use C-x r w <register> to store a window configuration in a register, and C-x r j <register> (where <register> is a single character) to jump back to it.

While this is a nice way for storing a few window configurations which you want to go back to after some time, I find winner-mode to be more convenient in a few regards. (For example, you won't have to bother naming the configurations).

Just put (winner-mode 1) in your .emacs, bind winner-undo and winner-redo to convenient shortcuts (or use the IMHO awkward C-c <left> and C-c <right> predefined ones), and you'll be able to switch back to previous window configurations.

See also: M-: (info "(emacs) Window Convenience") and M-: (info "(emacs) RegConfig")

danlei