From 1a0fb88897fb4d71949f5a9f2ccca179c6c4eab6 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 14 Apr 2025 15:01:40 -0400 Subject: [PATCH] feat: doom-quit-p: use popup dialog if available Mainly for Android UX, but also for consistency for folks who *like* GUI dialog boxes (seek professional help). Amend: 6a44a2ea80a7 --- lisp/lib/ui.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/lib/ui.el b/lisp/lib/ui.el index 2b9e0035c..7a7c5fc2e 100644 --- a/lisp/lib/ui.el +++ b/lisp/lib/ui.el @@ -19,7 +19,14 @@ If FORCE-P is omitted when `window-size-fixed' is non-nil, resizing will fail." Returns t if it is safe to kill this session. Does not prompt if no real buffers are open." (or (not (ignore-errors (doom-real-buffer-list))) - (yes-or-no-p (format "%s" (or prompt "Really quit Emacs?"))) + (if (use-dialog-box-p) + (pcase (x-popup-dialog + t `("Really quit Emacs?" + ("Quit anyway" . t) + ("Cancel" . nil))) + ('quit-anyway t) + ('cancel nil)) + (yes-or-no-p (format "%s" (or prompt "Really quit Emacs?")))) (ignore (message "Aborted"))))