title: Emacs desktop: frame splits and server mode
body: <p>I have the following on my <code>.emacs</code> file:</p>
  
  <pre><code>(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)
  </code></pre>
  
  <p>I usually start an Emacs server <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html" rel="nofollow">server mode</a> and then call <code>emacsclient -c</code> to start a session.</p>
  
  <ol>
  <li><p>I think my <code>locks</code> are not being released correctly when I close my Emacs client or server (to patch this problem, I am setting <code>desktop-load-locked-desktop</code> to <code>t</code> above). As far as I understand, <code>M-x kill-emacs</code> kills the server while <code>C-x C-c</code> kills the client. But when does Emacs <strong>save the desktop</strong>?, when killing the <strong>server</strong> or when killing the <strong>client</strong>?</p></li>
  <li><p>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?</p></li>
  </ol>
  
  <p>This is all on Emacs 24.2.1 (latest stable version when the question was asked)</p>