summaryrefslogtreecommitdiff
path: root/bin/emacsclient
diff options
context:
space:
mode:
Diffstat (limited to 'bin/emacsclient')
-rwxr-xr-xbin/emacsclient16
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/emacsclient b/bin/emacsclient
index 8cb4b75b..c30b341a 100755
--- a/bin/emacsclient
+++ b/bin/emacsclient
@@ -44,8 +44,22 @@ installed_emacsclient="$(PATH=$(echo "$PATH" \
| sed -e "s#$HOME/src/dotfiles/bin:##") \
command -v emacsclient)"
+defer () {
+ for arg do
+ shift
+ case "$arg" in
+ '--spw/installed') ;;
+ '--spw/no-start') may_start=false ;;
+ '--spw/'*) echo >&2 "emacsclient: cannot handle $arg"; exit 1 ;;
+ *) set -- "$@" "$arg"
+ esac
+ done
+ $may_start && set -- -a "" "$@"
+ exec "$installed_emacsclient" "$@"
+}
+
for cmd in bash flock inotifywait perl pwdx ss; do
- command -v $cmd >/dev/null || exec "$installed_emacsclient" -a "" "$@"
+ command -v $cmd >/dev/null || defer "$@"
done
[ -n "$BASH_VERSION" ] || exec bash "$0" "$@"