Preserve window layout in Emacs

0 votes
asked Apr 3, 2010 by hekevintran

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

5 Answers

0 votes
answered Apr 4, 2010 by nifle

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.

0 votes
answered Apr 4, 2010 by danlei

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")

0 votes
answered Apr 16, 2011 by einselbst

I know you allready accepted an answer, however because I understand your question in another way (concerning layout) and this question showed up for me when I was in search for something to persist my emacs window layout, I would like to mention:


which purpose is to save and restore the way, emacs windows are layed out and many more.

0 votes
answered Apr 1, 2016 by tangxinfa

Give a try, if you just want to restore window layout latter.

0 votes
answered Sep 15, 2017 by shellaylee

If you want to persist a layout in your hard-drive, desktop-save is the option.

If you need to store multiple layouts during emacs' process life (e.g. you connect to a long-running emacs daemon using emacsclient), you can use C-x r f <register> to store the frame layout in some register (C-x r j <register> for restore).

This works like charm since the stored layout is available when you quit the emacsclient session and reconnect later (in this case window layouts stored by C-x r w would be gone).

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter