I start emacs with emacs --daemon when the computer starts up, and then open a new graphical frame with emacsclient -c -n.
According to https://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html:
If you omit a filename argument while supplying the ‘-c’ option, the new frame displays the scratch buffer by default. If initial-buffer-choice is a string, the new frame displays that file or directory instead.
I have (setq initial-buffer-choice "~/") in my ~/.emacs. However, when I open a new frame, it still starts *scratch*, rather than ~. I have a ~ buffer, but it's not the displayed initially.
Is there something else I need to do to prevent the *scratch* buffer (which I never use) from being created?
Even with a minimal ~/.emacs which only has (setq initial-buffer-choice "~/"), upon starting a new frame with emacsclient -c -n, it still opens up with *scratch*.
This behavior appears to be limited to versions before 24. In emacs 23, emacsclient -c (or emacsclient -t) always opens to *scratch*, even when initial-buffer-choice is set. This is fixed in emacs 24, so the solution is to upgrade.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With