if [ -x /usr/bin/emacsclient ] && [ -x /usr/bin/emacs ]; then
# reset the tempdir to deal with setuid things clearing it
export TMPDIR="$(echo ~/tmp)";
- if ( emacsclient -n -e '()' </dev/null >/dev/null); then
- if [ -n "$DISPLAY" ]; then
- exec emacsclient -nw "$@";
- else
- exec emacsclient -c "$@";
- fi;
+ if [ -z "$DISPLAY" ]; then
+ exec emacsclient --alternate-editor /usr/bin/vi -c -nw "$@";
+ else
+ exec emacsclient --alternate-editor /usr/bin/vi -c "$@";
fi;
fi;
if [ -x /usr/bin/gnuclient ] && [ -x /usr/bin/emacs ]; then