2

I defined emacsclient as default editor in .bashrc so emacs -daemon will be called upon startup:

export ALTERNATE_EDITOR=""
export EDITOR=emacsclient

But compared to a normal load without client, if I call emacsclient afile, then some ui elements are missing, like the scrollbar, which will disappear, and the speedbar pictures, which will be replaced with "+" sign. Apparently the init file is not fully loaded by emacs daemon? What could possibly caused the difference and how can it be fixed?

enter image description here

a) Above is a normal load with emacs afile, same with emacs ; emacsclient -c afile.

b) Below is a client load with emacsclient -c afile after emacs --daemon &

1 Answers1

3

I imagine you have code running at init time which checks to see whether or not you are running a GUI emacs (via display-graphic-p or similar), and configures certain settings based on that.

(display-graphic-p) returns t at init time when a GUI non-daemon Emacs starts, because a graphical frame is created beforehand; but that function call returns nil at init time when a daemon starts, as no GUI frame is current at that time (and obviously the daemon has no idea whether any GUI frames are ever going to exist).

phils
  • 48,657
  • 3
  • 76
  • 115