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?