X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sane_editor;h=dd1aec75de8f2de3d691b37e27f1702c92605c61;hb=7072dd6217d2a600f729188624f228b5700bd836;hp=b12b99ff4d5ad48af9463ed4cf862e263d88d767;hpb=7c5739a677884afa8824b6fe8da7968535940457;p=bin.git diff --git a/sane_editor b/sane_editor index b12b99f..dd1aec7 100755 --- a/sane_editor +++ b/sane_editor @@ -9,17 +9,20 @@ # ed # modify the gsrvdir check to search for directories that are owned by me +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 [ -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 if ( gnuclient -batch < /dev/null >/dev/null); then exec gnuclient "$@"; fi; fi; -if [ -x /usr/bin/jed ]; then - exec jed "$@"; -fi; -if [ -x /usr/bin/juno ]; then - exec juno "$@"; -fi; if [ -x /usr/bin/vi ]; then exec vi "$@"; fi;