I love using Emacsserver and Emacsclient, as it saves all of my buffers so that if I log in via ssh and then log out, all of my buffers are saved.

However, when I log into Emacsserver after quitting from another session, the layout (for instance how many windows I have and how they are set up) is gone, and I always start from a Scratch buffer.

In the past I have used TMUX to make it so that when I reconnect to a terminal session, my Emacs session was identical to how I left it.

Even if I minimize Emacsserver before exiting ^z upon reconnecting all of my window set up information is lost.

Is there a way to have Emacsserver remember all your window placement options?

  • 1
    FYI you're creating a new frame when you connect with emacsclient, so you wouldn't expect Emacs to set a window configuration for that frame any more than you'd expect it to do so when creating one with C-x 5 2. There will be solutions to the problem, but that's why it behaves this way by default. – phils Nov 10 '16 at 23:49
  • This default behavior makes sense to me, I am really asking if there is any way that it is possible. – Startec Nov 10 '16 at 23:59
  • 1
    The frameset library is probably what you want to look at. As an easy manual example/demonstration, try C-x r f a before closing one client, and C-x r j a after opening another. – phils Nov 11 '16 at 0:00
  • Could you point me to where I can find an explanation of what this is doing? Also, does this seem like the right way to do what I want to do (basically just have a persistent window set up upon connection)? – Startec Nov 13 '16 at 0:01
  • 1
    I can only point you at the library code itself. As you can see with C-h k the two commands are calling frameset-to-register and frameset--jump-to-register respectively. Ultimately they are using frameset-save and frameset-restore. – phils Nov 15 '16 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.