syncthing stuff
[distro-setup] / g
1 #!/bin/bash
2
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
6 # git to load path.
7
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.
16
17
18 if pgrep -u $EUID emacsclient && (( $# )); then
19 emacsclient -a "" -n "$@"
20 else
21 emacsclient -a "" -nc "$@"
22 fi