Add fat-finger-exit

This commit is contained in:
Case Duckworth 2021-09-14 16:56:46 -05:00
parent 01a8bdd923
commit c5b6a0774d
2 changed files with 13 additions and 2 deletions

View File

@ -781,8 +781,7 @@ AKA, DO NOT USE THIS FUNCTION!!!"
"C-x o" #'acdw/other-window-or-switch-buffer
"C-x O" #'acdw/other-window-or-switch-buffer-backward
"C-c _" #'add-file-local-variable
"C-x C-c" #'delete-frame ; I keep fat-fingering and exiting
)
"C-x C-c" #'acdw/fat-finger-exit)
(:with-map toggle-map
(:bind "c" #'column-number-mode

View File

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