Commit | Line | Data |
---|---|---|
e04c4857 MW |
1 | #! /bin/sh |
2 | ||
3 | set -e | |
4 | editor=${MDW_EDITOR-ed} | |
e2fd2096 | 5 | emacsclient=t |
8ec7231c | 6 | [ -t 0 -a -t 1 ] || TERM=dumb |
e04c4857 | 7 | case "$EDITOR,$VISUAL,$TERM" in |
e2fd2096 | 8 | mdw-editor,mdw-editor,dumb) editor=emacsclient emacsclient=nil;; |
e04c4857 | 9 | mdw-editor,mdw-editor,*);; |
e04c4857 | 10 | mdw-editor,*,*) editor=$VISUAL;; |
9db17a65 | 11 | *,*,*) editor=$EDITOR;; |
e04c4857 | 12 | esac |
e2fd2096 MW |
13 | case "$emacsclient" in |
14 | t) exec emacsclient -nw -a "$editor" "$@";; | |
15 | nil) exec $editor "$@";; | |
16 | esac |