summaryrefslogtreecommitdiff
path: root/kolwynia/home/bdunahu/files/.config/emacs/modules/bd--utility.el
diff options
context:
space:
mode:
Diffstat (limited to 'kolwynia/home/bdunahu/files/.config/emacs/modules/bd--utility.el')
-rw-r--r--kolwynia/home/bdunahu/files/.config/emacs/modules/bd--utility.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/kolwynia/home/bdunahu/files/.config/emacs/modules/bd--utility.el b/kolwynia/home/bdunahu/files/.config/emacs/modules/bd--utility.el
index ee74f58..5ab0105 100644
--- a/kolwynia/home/bdunahu/files/.config/emacs/modules/bd--utility.el
+++ b/kolwynia/home/bdunahu/files/.config/emacs/modules/bd--utility.el
@@ -155,6 +155,15 @@ ARG can be one of the following:
(ignore-errors (cond ((bufferp proc) (kill-buffer proc))
((stringp proc) (interrupt-process proc)))))
+(defun bd/kill-current-buffer ()
+ "Kill the current buffer. Asks confirmation for IRC or Scratch buffer types."
+ (interactive)
+ (let* ((buf (current-buffer))
+ (name (buffer-name buf)))
+ (or (and (or (bd/buffer-scratch-p buf)
+ (bd/buffer-irc-p buf))
+ (not (yes-or-no-p (concat "Really kill " name "?"))))
+ (kill-current-buffer))))
(provide 'bd--utility)
;;; bd--utility.el ends here