From 34a2658f97f093dc669c81bfc8a284dcd00b8db2 Mon Sep 17 00:00:00 2001 From: TEC Date: Wed, 30 Dec 2020 16:33:35 +0800 Subject: [PATCH] Add --wait flag to emacsclient script --- config.org | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index dc830f4..5360711 100644 --- a/config.org +++ b/config.org @@ -970,6 +970,7 @@ to add a few bells and whistles. #+begin_src shell :tangle ~/.local/bin/e :mkdirp yes :shebang "#!/usr/bin/env sh" :comments none force_tty=false +force_wait=false stdin_mode="" args=() @@ -979,6 +980,9 @@ while :; do -t | -nw | --tty) force_tty=true shift ;; + -w | --wait) + force_wait=true + shift ;; -m | --mode) stdin_mode=" ($2-mode)" shift 2 ;; @@ -990,6 +994,7 @@ Emacs client convenience wrapper. \033[1mOptions:\033[0m \033[0;34m-h, --help\033[0m Show this message \033[0;34m-t, -nw, --tty\033[0m Force terminal mode +\033[0;34m-w, --wait\033[0m Don't supply \033[0;34m--no-wait\033[0m to graphical emacsclient \033[0;34m-\033[0m Take \033[0;33mstdin\033[0m (when last argument) \033[0;34m-m MODE, --mode MODE\033[0m Mode to open \033[0;33mstdin\033[0m with @@ -1018,7 +1023,10 @@ if [ ! "$DISPLAY" = ":0" ] || $force_tty; then TERM="alacritty-direct"; fi emacsclient --tty -create-frame --alternate-editor="" "${args[@]}" else - emacsclient -create-frame --alternate-editor="" --no-wait "${args[@]}" + if ! $force_wait; then + args+=(--no-wait) + fi + emacsclient -create-frame --alternate-editor="" "${args[@]}" fi #+end_src