]> git.donarmstrong.com Git - bin.git/blobdiff - sane_editor
add mutt alias which executes neomutt if that exists
[bin.git] / sane_editor
index 56c98d9650561bf23006f841d4853746a0d6818d..dd1aec75de8f2de3d691b37e27f1702c92605c61 100755 (executable)
 
 # modify the gsrvdir check to search for directories that are owned by me
 if [ -x /usr/bin/emacsclient ] && [ -x /usr/bin/emacs ]; then
-    exec emacsclient -c "$@";
+    # 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