From aebb39ef3d978c9cef30085d323b3ccd6865ee48 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Thu, 5 Oct 2023 22:42:30 +0200 Subject: [PATCH] pinwheel: Handle stopping of `emacsclient` frames --- hosts/pinwheel/modules/emacs/config.org | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hosts/pinwheel/modules/emacs/config.org b/hosts/pinwheel/modules/emacs/config.org index 6ca09d7..8e40927 100644 --- a/hosts/pinwheel/modules/emacs/config.org +++ b/hosts/pinwheel/modules/emacs/config.org @@ -83,7 +83,6 @@ * Setup #+BEGIN_SRC emacs-lisp -(setq confirm-kill-processes nil) #+END_SRC ** Use wl-clipboard for interprocess copy/paste #+BEGIN_SRC emacs-lisp @@ -167,9 +166,17 @@ #+BEGIN_SRC emacs-lisp (set-fringe-mode 10) #+END_SRC -** Faster "confirm kill" +** Handle killing of emacs/frame #+BEGIN_SRC emacs-lisp - (setq confirm-kill-emacs 'y-or-n-p) + (setq confirm-kill-emacs nil) + (setq confirm-kill-processes nil) + + (define-advice delete-frame (:around (oldfun &rest args) confirm-frame-deletion) + "Confirm deleting the frame." + (interactive) + (when (y-or-n-p "Delete frame? ") + (save-some-buffers) + (apply oldfun args))) #+END_SRC ** Use ESC to quit prompts #+BEGIN_SRC emacs-lisp