[Fix #798] Prompt for confirmation in prelude-kill-other-buffers

This commit is contained in:
Bozhidar Batsov 2015-02-13 09:53:07 +02:00
parent 2a386116f1
commit dc861b7c8b

View file

@ -357,11 +357,12 @@ Repeated invocations toggle between the two most recently open buffers."
"Kill all buffers but the current one. "Kill all buffers but the current one.
Doesn't mess with special buffers." Doesn't mess with special buffers."
(interactive) (interactive)
(-each (when (y-or-n-p "Are you sure you want to kill all buffers but the current one? ")
(->> (buffer-list) (-each
(-filter #'buffer-file-name) (->> (buffer-list)
(--remove (eql (current-buffer) it))) (-filter #'buffer-file-name)
#'kill-buffer)) (--remove (eql (current-buffer) it)))
#'kill-buffer)))
(defun prelude-create-scratch-buffer () (defun prelude-create-scratch-buffer ()
"Create a new scratch buffer." "Create a new scratch buffer."