From: Mark Wooding Date: Mon, 9 Nov 2009 15:04:04 +0000 (+0000) Subject: bin/mdw-editor: Use `emacsclient' to edit files. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/e2fd2096c958f22c6beba9ac82641f8735193f55 bin/mdw-editor: Use `emacsclient' to edit files. Emacs 23 can open new frames in terminals quite happily. So we may as well use it rather than starting up new Emacsen. --- diff --git a/bin/mdw-editor b/bin/mdw-editor index 8b6e819..312995f 100755 --- a/bin/mdw-editor +++ b/bin/mdw-editor @@ -2,11 +2,15 @@ set -e editor=${MDW_EDITOR-ed} +emacsclient=t [ -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 -exec $editor "$@" +case "$emacsclient" in + t) exec emacsclient -nw -a "$editor" "$@";; + nil) exec $editor "$@";; +esac