Fork me on GitHub
#emacs
<
2019-07-16
>
adamfrey15:07:43

I'm running Emacs in daemon mode with emacs --daemon and then launching new emacs frames with emacsclient -c any time I want a new editor window. Is there a way that I could launch emacsclient in a way that would automatically open the last visited buffer instead of opening the default startup buffer? (Spacemacs landing page, in my case)

dpsutton15:07:56

if from the command line just emacsclient -c . for current working directory?

adamfrey16:07:52

Actually I'm getting closer to what I want with setting this in my emacs config:

(setq initial-buffer-choice '(lambda () (other-buffer (current-buffer) 1)))

adamfrey16:07:34

I'm a little confused as to which buffer it's choosing in every case, but I'm pretty close now

dmaiocchi16:07:07

I have also daemon setup with eMac works pretty fine

ag16:07:25

@adamfrey if you simply need Spacemacs landing page, why not call it with -e '(spacemacs/home)' ?

adamfrey16:07:21

no, I don't want the Spacemacs page, that's what I get now. I want whatever the last buffer I had focused in a previous Emacs frame

ag17:07:08

@adamfrey emacsclient -c -e '(spacemacs/alternate-buffer)'