From f315fd19f909b6c1480e3cbd039f03e931db6858 Mon Sep 17 00:00:00 2001 From: quotuva <127955750+quotuva@users.noreply.github.com> Date: Sat, 3 May 2025 01:28:04 +0000 Subject: [PATCH] Suppress duplicate confirmation when killing Emacs This happens when there are no EXWM buffers, and confirmation is required otherwise (unsaved buffers or running processes). * exwm.el (exwm--confirm-kill-emacs): Make the change. --- exwm.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exwm.el b/exwm.el index 2af36e9..03058a5 100644 --- a/exwm.el +++ b/exwm.el @@ -1112,7 +1112,7 @@ If FORCE is any other non-nil value, force killing of Emacs." ((and force (not (eq force 'no-check))) ;; Force killing Emacs. t) - ((or (eq force 'no-check) (not exwm--id-buffer-alist)) + ((eq force 'no-check) ;; Check if there's any unsaved file. (pcase (catch 'break (let ((kill-emacs-query-functions @@ -1123,8 +1123,9 @@ If FORCE is any other non-nil value, force killing of Emacs." (`break (y-or-n-p prompt)) (x x))) (t - (yes-or-no-p (format "[EXWM] %d X window(s) will be destroyed. %s?" - (length exwm--id-buffer-alist) prompt)))) + (or (not exwm--id-buffer-alist) + (yes-or-no-p (format "[EXWM] %d X window(s) will be destroyed. %s?" + (length exwm--id-buffer-alist) prompt))))) ;; Run `kill-emacs-hook' (`server-force-stop' excluded) before Emacs ;; frames are unmapped so that errors (if any) can be visible. (if (memq #'server-force-stop kill-emacs-hook)