From 33ae48437313571a4ff607df87f24cc1310466d5 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 14 Jan 2023 11:47:07 -0700 Subject: emacsclient wrapper: don't SIGTERM in-tree if gdbmacs unresponsive --- bin/emacsclient | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin/emacsclient') 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" & -- cgit v1.2.3