0

If I spawn Emacs in --daemon mode, I can then use emacsclient to connect to the daemon from within a terminal window. If this then dies, I can reconnect my terminal and my Emacs session is still available.

The only problem with this is that whatever window layout I had previously configured is not preserved. If I'm working on a flakey connection it becomes tedious having to partition up my screen with the window layout I want on each connection drop.

I am aware of commands such as

C-x r f – frame-configuration-to-register
C-x r j – jump-to-register

Which should make it possible to save and reload a frame configuration. Whilst these work fine in normal mode, in daemon mode I find that the results are very unpredictable.

Sometimes it just looses the layout! Also you end up having to remember to save the layout and exit using C-x 5 1 or multiple C-x 5 0, which kills the underlying emacsclient window without killing the underlying daemon.

There must be something better!

Firstly - is the daemon/client layout behaviour buggy, or am I misusing it somehow?

Secondly - Is there a stable way of automatically/seamlessly preserving your window layout between connections to an Emacs daemon?

  • As an alternative, if you run Emacs locally and open files using Tramp, then you won't lose your window layout when the connection dies. I think(?) tramp doesn't require a continuous connection either, so if you lose your connection you might not even notice, as Tramp will reconnect when necessary. – Tyler Nov 9 '17 at 16:29
  • Thanks - yes this would work for most people. I didn't mention it in my question, but for security reasons I'm not allowed to use tramp on my local machine. So although I use tramp elsewhere I'm stuck with terminal emacs - at least for now. – Phil Nov 10 '17 at 11:11
1

To answer my own question and having tried many ways to achieve the above, I've only found one method that at least so far has proved stable/reliable even when using the daemon.

https://github.com/tlh/workgroups.el

Or the slightly improved rewrite:

http://workgroups2.readthedocs.io/en/latest/

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.