added a few options for EDITOR
authorChris Koeritz <fred@gruntose.com>
Fri, 12 Apr 2013 20:51:50 +0000 (16:51 -0400)
committerChris Koeritz <fred@gruntose.com>
Fri, 12 Apr 2013 20:51:50 +0000 (16:51 -0400)
customizing/fred/fred_variables.sh

index feb32584f06a70c39a5c0ceb59e05bed1ecfe6dc..5ca2c3382bc405e775267dfef852d32342572413 100644 (file)
@@ -41,6 +41,15 @@ if [ -z "$NETHACKOPTIONS" ]; then
 
   # editor and other mixed settings...
   export EDITOR="$(which vim)"
+  if [ -z "$EDITOR" ]; then
+    EDITOR="$(which vi)"
+    if [ -z "$EDITOR" ]; then
+      EDITOR="$(which emacs)"
+      if [ -z "$EDITOR" ]; then
+        echo "Cannot find a friendly editor."
+      fi
+    fi
+  fi
   export VISUAL="$EDITOR"
   # the editors for revision control must wait while document is edited,
   # so gvim and others launched to x window are not appropriate.