Last active
August 29, 2015 14:03
-
-
Save erkyrath/90ae298f1cd6add8cc0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-filter (condp lst) | |
(delq nil | |
(mapcar (lambda (x) (and (funcall condp x) x)) lst))) | |
(defun too-many-buffers-query () | |
(let* ((ls (my-filter (lambda (buf) (buffer-file-name buf)) (buffer-list))) | |
(count (length ls))) | |
(if (> count 8) | |
(y-or-n-p (format "%d file buffers exist: really quit? " count)) | |
t)) | |
) | |
(add-hook 'kill-emacs-query-functions 'too-many-buffers-query) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment