1

I have the following on my .emacs file:

(desktop-save-mode 1)
(setq desktop-dirname             "~/.emacs.d/desktops/default/"
      desktop-base-file-name      "emacs.desktop"
      desktop-base-lock-name      "lock"
      desktop-path                (list desktop-dirname)
      desktop-load-locked-desktop t)

I usually start an Emacs server server mode and then call emacsclient -c to start a session.

  1. I think my locks are not being released correctly when I close my Emacs client or server (to patch this problem, I am setting desktop-load-locked-desktop to t above). As far as I understand, M-x kill-emacs kills the server while C-x C-c kills the client. But when does Emacs save the desktop?, when killing the server or when killing the client?

  2. When I reload my desktop, Emacs does not restore any frame splits. Can Emacs desktop save splits? If not, are there any alternatives to save and restore them?

This is all on Emacs 24.2.1 (latest stable version when the question was asked)

Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564

1 Answers1

3
  1. Emacs does not release the locks when killing "the" client (there can be several clients at the same time). I guess we could make desktop.el try to save the desktop whenever the last client gets disconnected, or rather when the last frame gets destroyed. Please M-x report-emacs-bug to request this new behavior.

  2. AFAIK desktop.el still does not know how to save "frame splits" (which Emacs calls window-configurations). I think this is the same question as Saving Window Configurations in Emacs

Community
  • 1
  • 1
Stefan
  • 27,908
  • 4
  • 53
  • 82