]> git.donarmstrong.com Git - bin.git/commitdiff
update sane editor
authorDon Armstrong <don@donarmstrong.com>
Tue, 6 Dec 2011 04:27:30 +0000 (04:27 +0000)
committerDon Armstrong <don@donarmstrong.com>
Tue, 6 Dec 2011 04:27:30 +0000 (04:27 +0000)
sane_editor

index 56c98d9650561bf23006f841d4853746a0d6818d..44cf0afa3fd49045b81389c2908d77e21e0dcfd1 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 ( emacsclient -n -e '()' </dev/null >/dev/null); then
+       if [ -n "$DISPLAY" ]; then
+           exec emacsclient -nw "$@";
+       else
+           exec emacsclient -c "$@";
+       fi;
+    fi;
 fi;
 if [ -x /usr/bin/gnuclient ] && [ -x /usr/bin/emacs ]; then
     if ( gnuclient -batch < /dev/null >/dev/null); then