Emacs 23 can open new frames in terminals quite happily. So we may as
well use it rather than starting up new Emacsen.
set -e
editor=${MDW_EDITOR-ed}
set -e
editor=${MDW_EDITOR-ed}
[ -t 0 -a -t 1 ] || TERM=dumb
case "$EDITOR,$VISUAL,$TERM" in
[ -t 0 -a -t 1 ] || TERM=dumb
case "$EDITOR,$VISUAL,$TERM" in
- mdw-editor,mdw-editor,dumb) editor=gnuclient;;
+ mdw-editor,mdw-editor,dumb) editor=emacsclient emacsclient=nil;;
mdw-editor,mdw-editor,*);;
mdw-editor,*,*) editor=$VISUAL;;
*,*,*) editor=$EDITOR;;
esac
mdw-editor,mdw-editor,*);;
mdw-editor,*,*) editor=$VISUAL;;
*,*,*) editor=$EDITOR;;
esac
+case "$emacsclient" in
+ t) exec emacsclient -nw -a "$editor" "$@";;
+ nil) exec $editor "$@";;
+esac