X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/7a24847d3157b33643cd154019731e24294f27f1..572d95bda58d1d6e5d28c77e05c9e00f47a1e8db:/bin/mdw-editor diff --git a/bin/mdw-editor b/bin/mdw-editor index 2c7535b..aa52fd5 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 | \ @@ -15,5 +16,5 @@ case "$EDITOR,$VISUAL,$TERM" in esac case "$emacsclient" in t) exec emacsclient -nw -a "$editor" "$@";; - nil) exec $editor "$@";; + *) exec $editor "$@";; esac