Saving Window Layout in Emacs

I installed my windows in a certain way. How to save this parameter for later recall?

+57
emacs
Apr 03 '10 at
source share
5 answers

Check emacs desktop . I do not have emacs, but I believe that this is part of the standard lisp packages that you get when installing emacs.

Use the desktop library to save Emacs state from one session to another. As soon as you save Emacs desktop - buffers, file names, main modes, buffer positions, etc. subsequent Emacs sessions reload the saved desktop.

+23
Apr 04 2018-10-10T00:
source share

I sometimes use Cx rw <register> to store the window configuration in a register, and Cx rj <register> (where <register> is the only character) to return to it.

Although this is a good way to save multiple window configurations that you want to return to after a while, I find the winner mode to be more convenient in several ways. (For example, you don’t have to worry about naming configurations).

Just put (winner-mode 1) in your .emacs, bind winner-undo and winner-redo to convenient shortcuts (or use the predefined IMHO Cc <left> and Cc <right> ), and you can switch back to the previous window configurations.

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

+57
Apr 04 '10 at 17:33
source share

I know that you all already accepted the answer, however, because I understand your question differently (regarding the layout), and this question came up for me when I was looking for something to save my emacs window layout, I would like mention

workgroups.el

whose goal is to save and restore the path, release emacs windows and much more.

+30
May 16 '11 at 10:35
source share

Try Layout Restore if you just want to restore the window layout later.

+2
Jan 01 '15 at 8:32
source share

If you want to save the layout to your hard drive, desktop-save .

If you need to save several layouts during the lifetime of the emacs process (for example, you connect to a long-running emacs daemon using emacsclient ), you can use Cx rf <register> to save the frame layout in some register and Cx rj <register> recovery.

Since from time to time I remotely connect to the workstation to execute sth, disconnect for a while, and then reconnect, restoring the layout helps me to continue working smoothly (note that in this case the window layouts saved in Cx rw would disappear )

+1
Sep 10 '17 at 22:15
source share



All Articles