From 9a34015a7cd6c205ec82b473d24cb4537ee881a7 Mon Sep 17 00:00:00 2001
From: Don Armstrong <don@donarmstrong.com>
Date: Thu, 23 Feb 2012 03:21:46 +0000
Subject: [PATCH] use vi as an alternate editor, test display

---
 sane_editor | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/sane_editor b/sane_editor
index 03aab78..dd1aec7 100755
--- a/sane_editor
+++ b/sane_editor
@@ -12,12 +12,10 @@
 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 [ -z "$DISPLAY" ]; then
- 	    exec emacsclient -c -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
-- 
2.39.5