diff options
Diffstat (limited to 'bin/emacsclient')
-rwxr-xr-x | bin/emacsclient | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/emacsclient b/bin/emacsclient index 12630575..b980860b 100755 --- a/bin/emacsclient +++ b/bin/emacsclient @@ -55,13 +55,18 @@ defer () { esac done $may_start && set -- -a "" "$@" - exec "$installed_emacsclient" "$@" + if [ -n "$BASH_VERSION" ]; then + exec -a emacsclient "$installed_emacsclient" "$@" + else + exec "$installed_emacsclient" "$@" + fi } -for cmd in bash flock inotifywait perl pwdx ss; do +[ -n "$BASH_VERSION" ] \ + || { command -v bash >/dev/null && exec bash "$0" "$@" || defer "$@"; } +for cmd in flock inotifywait perl pwdx ss; do command -v $cmd >/dev/null || defer "$@" done -[ -n "$BASH_VERSION" ] || exec bash "$0" "$@" # We have to do this to break up clustered short options. An unfortunate # consequence is maintaining a copy of all of emacsclient(1)'s long opts here. |