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:
Henrik Lissner 2017-06-11 14:05:14 +02:00
parent d8c7ce8c4e
commit 66cfbb2563
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 28 additions and 3 deletions

View file

@ -50,3 +50,12 @@ window changes before then, the undo expires."
(doom-resize-window (truncate (/ (frame-width) 1.2)) t)
(doom-resize-window (truncate (/ (frame-height) 1.2)))
t)))
;;;###autoload
(defun doom/delete-frame ()
"Delete the current frame, but ask for confirmation if it isn't empty."
(interactive)
(if (cdr (frame-list))
(when (doom-quit-p "Close frame?")
(delete-frame))
(save-buffers-kill-emacs)))