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: 6a44a2ea80
This commit is contained in:
Henrik Lissner
2025-04-14 15:01:40 -04:00
parent 6a44a2ea80
commit 1a0fb88897

View File

@ -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"))))