summaryrefslogtreecommitdiff
path: root/bin/emacsclient
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-01-14 11:47:07 -0700
committerSean Whitton <spwhitton@spwhitton.name>2023-01-14 11:47:10 -0700
commit33ae48437313571a4ff607df87f24cc1310466d5 (patch)
treea46c530c0439fe4d7fa2a42774c46c507032d056 /bin/emacsclient
parente3b8160a2b4325af304db3bc33b1c5befe4c6183 (diff)
downloaddotfiles-33ae48437313571a4ff607df87f24cc1310466d5.tar.gz
emacsclient wrapper: don't SIGTERM in-tree if gdbmacs unresponsive
Diffstat (limited to 'bin/emacsclient')
-rwxr-xr-xbin/emacsclient4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/emacsclient b/bin/emacsclient
index a6c6cb14..c29a86ee 100755
--- a/bin/emacsclient
+++ b/bin/emacsclient
@@ -198,11 +198,13 @@ fi
# Make it possible, with primary session, to quickly replace in-tree Emacs
# with installed Emacs. See 'C-i E' Sway/i3 binding.
if [ -z "$daemon_name" ] && $devel_running && $want_installed; then
+ gud_status \
+ || fail "couldn't query gdbmacs for in-tree Emacs status; aborting"
# If in-tree Emacs appears wedged, just delete the socket and start up an
# installed daemon. The idea is that I'll only type C-i E if I know
# that's not just wedged but crashed, and I want to keep that state in gdb
# but get another primary daemon up in the meantime.
- if gud_status && [ "$gud_status" = t ]; then
+ if [ "$gud_status" = t ]; then
rm "$socket"
else
inotifywait -qq --timeout "${timeout:-15}" -e delete_self "$socket" &