3 # note: starting emacs server can hang due to errors in init files
4 # which don't cause problems for non-server emacs. And things
5 # that aren't errors can cause hang too, like when I added gnus
8 # I was experimenting with running
9 # under gdb always to diagnose any hangs/crashes
10 # and it won't work due to a gdb crash:
11 # gdb -ex="set follow-fork-mode child" -ex=r -ex=quit --args emacsclient -nc
12 # -n = --no-wait, go into background
13 # -c = create new frame instead of reusing the current frame
14 # -a = alternate editor, empty string makes it start emacs daemon.
15 # This is also set via env variable, but that doesn't propagate everywhere.
18 if pgrep
-u $EUID emacsclient
&& (( $# )); then
19 emacsclient
-a "" -n "$@"
21 emacsclient
-a "" -nc "$@"