X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/blobdiff_plain/b200af264adeb1c362508740e601d0b8792a49a5..7e50381192d916a5034b87956725b5b86a9c58a2:/bin/mdw-editor diff --git a/bin/mdw-editor b/bin/mdw-editor index 312995f..96387e8 100755 --- a/bin/mdw-editor +++ b/bin/mdw-editor @@ -2,7 +2,8 @@ set -e editor=${MDW_EDITOR-ed} -emacsclient=t +emacsclient=$( + emacsclient --eval '(>= emacs-major-version 23)' 2>/dev/null || :) [ -t 0 -a -t 1 ] || TERM=dumb case "$EDITOR,$VISUAL,$TERM" in mdw-editor,mdw-editor,dumb) editor=emacsclient emacsclient=nil;; @@ -12,5 +13,5 @@ case "$EDITOR,$VISUAL,$TERM" in esac case "$emacsclient" in t) exec emacsclient -nw -a "$editor" "$@";; - nil) exec $editor "$@";; + *) exec $editor "$@";; esac