]> git.donarmstrong.com Git - bin.git/blob - sane_editor
add a VERBOSE flag to getmail
[bin.git] / sane_editor
1 #!/bin/sh
2
3 # Order of preference
4 # gnuclient
5 # jed
6 # juno
7 # vi
8 # nano
9 # ed
10
11 # modify the gsrvdir check to search for directories that are owned by me
12 if [ -x /usr/bin/emacsclient ] && [ -x /usr/bin/emacs ]; then
13     # reset the tempdir to deal with setuid things clearing it
14     export TMPDIR="$(echo ~/tmp)";
15     if [ -z "$DISPLAY" ]; then
16         exec emacsclient --alternate-editor /usr/bin/vi -c -nw "$@";
17     else
18         exec emacsclient --alternate-editor /usr/bin/vi -c "$@";
19     fi;
20 fi;
21 if [ -x /usr/bin/gnuclient ] && [ -x /usr/bin/emacs ]; then
22     if ( gnuclient -batch < /dev/null >/dev/null); then
23         exec gnuclient "$@";
24     fi;
25 fi;
26 if [ -x /usr/bin/vi ]; then
27     exec vi "$@";
28 fi;
29 if [ -x /usr/bin/nano ]; then 
30     exec nano "$@";
31 fi;
32 if [ -x /usr/bin/ed ]; then
33     exec ed "$@";
34 fi;
35 echo "Unable to find a suitable editor" >/dev/stderr;
36 exit 1;