mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Fix quit confirmations in daemon; add for frames
+ Add quit confirmation when closing a frame with real buffers + Ensure quit confirmations also work in daemon frames (tty or gui)
This commit is contained in:
@ -34,12 +34,23 @@
|
||||
pos-tip-border-width 1
|
||||
;; no beeping or blinking please
|
||||
ring-bell-function #'ignore
|
||||
visible-bell nil
|
||||
;; Ask for confirmation on quit only if real buffers exist
|
||||
confirm-kill-emacs (lambda (_) (if (doom-real-buffers-list) (y-or-n-p "››› Quit?") t)))
|
||||
visible-bell nil)
|
||||
|
||||
(fset #'yes-or-no-p #'y-or-n-p) ; y/n instead of yes/no
|
||||
|
||||
;; Ask for confirmation when trying to kill emacs or close a frame that has real
|
||||
;; buffers open in it.
|
||||
(defun doom-quit-p (&optional prompt)
|
||||
"Return t if this session should be killed; prompts the user for
|
||||
confirmation."
|
||||
(interactive)
|
||||
(if (ignore-errors (doom-real-buffers-list))
|
||||
(or (yes-or-no-p (format "››› %s" (or prompt "Quit Emacs?")))
|
||||
(ignore (message "Aborted")))
|
||||
t))
|
||||
(setq confirm-kill-emacs nil)
|
||||
(add-hook 'kill-emacs-query-functions #'doom-quit-p)
|
||||
|
||||
;; show typed keystrokes in minibuffer
|
||||
(setq echo-keystrokes 0.02)
|
||||
;; ...but hide them while isearch is active
|
||||
@ -119,6 +130,8 @@ mode is detected.")
|
||||
;; Bootstrap
|
||||
;;
|
||||
|
||||
(global-set-key [remap delete-frame] #'doom/delete-frame)
|
||||
|
||||
;; auto-enabled in Emacs 25+; I'd rather enable it manually
|
||||
(global-eldoc-mode -1)
|
||||
|
||||
|
Reference in New Issue
Block a user