diff options
| author | bdunahu <bdunahu@operationnull.com> | 2026-01-14 17:20:42 -0700 |
|---|---|---|
| committer | bdunahu <bdunahu@operationnull.com> | 2026-01-14 17:20:42 -0700 |
| commit | 06fc66678c4affe269fc6abe2dfee6b0d275da19 (patch) | |
| tree | c0c21ddf9712e63e6aa447dae958b3a55dc7671f /kolwynia/home/bdunahu/files/.config/emacs/modules/bd--utility.el | |
| parent | 64dc891ba68c1783f31f745a165dbc540e47a5e6 (diff) | |
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.el | 9 |
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 |
