10

I followed some answers here, customizing a workspace, where I had several windows sized how I wanted them. I saved this session, as per instructions, here. While I see that I now have a .emacs.desktop file in that directory, I can't seem to understand how to load my desktop configuration. When I emacs .emacs.desktop or C-x c-f .emacs.desktop, that only edits the file itself, rather than loading the configuration. How can I start with a restored configuration?

Community
  • 1
  • 1
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
  • 2
    Are you interested in using `desktop.el`? http://www.emacswiki.org/emacs/DeskTop Or, are you using something else? Also, do you have a current stable version of Emacs, or a developer build (e.g., Emacs Trunk), or an older version (if so, perhaps consider upgrading)? My understanding is that the snapshot developer build has features for restoring windows and frames. – lawlist Dec 07 '13 at 16:25
  • Hmm, not sure, you make me realize I'm in a bit over my head. My objective is just to be able to return to a workspace that looks just like this when I work on this particular project as easily as possible---I'm open to whatever is the recommended way of doing that. – Mittenchops Dec 07 '13 at 22:31
  • You might want to take a look at http://www.emacswiki.org/emacs/SessionManagement – phils Dec 09 '13 at 04:00

4 Answers4

16

I have a similar setup, and M-x desktop-change-dir works for me. You will then be prompted to enter the path to your .emacs.desktop file, or you can create a new one. After that, your desktop/workspace should be loaded.

Also, each desktop configuration will have its own .emacs.desktop file.

modulitos
  • 14,737
  • 16
  • 67
  • 110
2

The same doc you pointed to (your second link -- the Emacs manual) tells you how to restore a desktop that has been saved: Customize option desktop-save-mode to non-nil (or put (desktop-save-mode 1) in your init file). That should be all you need to do. Did you try that?

M-x customize-option desktop-save-mode

Drew
  • 29,895
  • 7
  • 74
  • 104
  • OK, I've tried that. I just ran `M-x customize-option desktop-save-mode` so the switch is toggled. However, I still don't see how to load my configuration. When I open the configuration it's a text file, not my multi-windows setup of several files, etc. – Mittenchops Dec 07 '13 at 22:35
  • And `M-x desktop revert`, from the second link, returns 'unknown desktop directory' – Mittenchops Dec 07 '13 at 22:36
  • 1
    1. As @lawlist pointed out, `desktop.el` saves and restores window and frame configurations only in recent development snapshots. That will be in Emacs 24.4, which will be released "soon". 2. The error sounds like Desktop is unable to determine where to find your desktop file. See the doc for more info. Otherwise, you will need to dig into your setup more to debug it. See the doc regarding the location of the desktop file -- it is not being found where Desktop is looking for it. You really need to start with the doc. – Drew Dec 07 '13 at 22:52
  • I don't know what I'm looking for in the doc, or have enough context to understand it, so telling me to read the manual will not help. I also do not know where to find debug information. – Mittenchops Dec 08 '13 at 23:04
2

The .emacs.desktop file is ~/.emacs.d directory by default.

You just need to have (desktop-save-mode t) in your init.el, to load the saved emacs configuration from the previous session.

Everytime you make changes to the buffer and save it, all of it is going to reloaded the next time you reopen emacs.

This setting is going to remember things like cursor position, buffers, etc.

Saurabh
  • 5,176
  • 4
  • 32
  • 46
0

Maybe this bingoes your question

M-: (desktop-read DIRNAME)

, or you can invoke the defaults with

M-x desktop-read

or with

M-: (desktop-read)

, finally, you can also run the help:

C-h f desktop-read 
agave6
  • 1
  • 2