From c5b6a0774db7ecb2920db342abab5dbf5bcad9fb Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 14 Sep 2021 16:56:46 -0500 Subject: Add fat-finger-exit --- lisp/acdw.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lisp/acdw.el') diff --git a/lisp/acdw.el b/lisp/acdw.el index 91381da..b8a1906 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -632,6 +632,18 @@ This function is internal. Use `acdw/make-password-fetcher' instead." (interactive "p") (dotimes (or n 1) (insert "💩"))) + +;;; Fat finger solutions +(defun acdw/fat-finger-exit (&optional prefix) + "Delete a frame, or kill Emacs with confirmation. +When called with PREFIX, just kill Emacs without confirmation." + (interactive "P") + (if (or prefix + (and (= 1 (length (frame-list))) + (yes-or-no-p "This is the last frame! Wanna quit?"))) + (kill-emacs) + (ignore-errors + (delete-frame)))) (provide 'acdw) ;;; acdw.el ends here -- cgit 1.4.1-21-gabe81