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*.
initial-scratch-buffervariable). Can you start up the daemon, open a client, and then check whatinitial-buffer-choiceevaluates to? - Daninitial-scratch-bufferon another stackoverflow answer. How do I check the value of a variable? - Dan Jonesinitial-scratch-message(which controls that line of text at the top of the scratch buffer), but that won't be related to this question. To check the value ofinitial-buffer-choice, hitM-:(orM-x eval-expression) and then enterinitial-buffer-choice, which will tell you what that variable evaluates to. - Dan(eval initial-buffer-choice)into the *scratch* buffer (that showed up when launched with emacsclient -c), and evaluated itC-x C-e, and it said "~/" in the mini-buffer. - Dan Jones