From 7bae01d026509830800f2cacdb756462823a011d Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 21 Oct 2022 09:45:47 -0700 Subject: emacsclient wrapper: start inotifywait(1) earlier --- bin/emacsclient | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin/emacsclient') diff --git a/bin/emacsclient b/bin/emacsclient index 770ef66a..fe08427d 100755 --- a/bin/emacsclient +++ b/bin/emacsclient @@ -73,7 +73,10 @@ if [ -n "$listener" ]; then esac fi +# ---- Special case for primary session that's always under gdb if [ -z "$daemon_name" ] && $devel_running && $want_installed; then + inotifywait -qq -e delete "$socket" & + inotifywait=$! kill "$listener" # Detach gdb so that Emacs can handle the SIGTERM. @@ -83,9 +86,10 @@ if [ -z "$daemon_name" ] && $devel_running && $want_installed; then && emacsclient -sgdbmacs --eval '(gud-basic-call "detach")' \ --eval '(gud-basic-call "quit")' - [ -e "$socket" ] && inotifywait -qqt 2 -e delete "$socket" + wait $inotifywait devel_running=false fi +# ---- End special case for primary session that's always under gdb [ -z "$listener" ] && ! $may_start && exit 0 -- cgit v1.2.3