reddit / emacs

How can I kill a buffer which has no process left with confirmation?

Likhon-BaRoy · 2022-11-11 10:05
Here's a description image. https://preview.redd.it/iutmkvsopaz91.png?width=442&format=png&auto=webp&s=e835b730517c097ff68657300146a8509a33deb7
MitchellMarquez42 · 2022-11-11 16:06
(defun maybe-kill-buffer () (interactive) (if (y-or-n-p "Are you sure you want to kill the current buffer?) (kill-buffer (current-buffer)))) Or something like that.