From 8ce816fbb14919bbed1aec57e157c9b254c7b18f Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Thu, 31 Oct 2019 18:56:53 +0900 Subject: [PATCH] Add my-force-query-kill-current-buffer --- emacs.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs.el b/emacs.el index 0bca9e6..3050d60 100644 --- a/emacs.el +++ b/emacs.el @@ -1810,6 +1810,13 @@ found, otherwise returns nil." (interactive) (if (y-or-n-p (concat "kill current buffer? :")) (kill-buffer (current-buffer)))) +(defun my-force-query-kill-current-buffer () + "Interactively kill current buffer." + (interactive) + (when (y-or-n-p (concat "kill current buffer? :")) + (let ((kill-buffer-hook nil) + (kill-buffer-query-functions nil)) + (kill-buffer (current-buffer))))) ;;(global-set-key "\C-xk" 'my-query-kill-current-buffer) (substitute-key-definition 'kill-buffer 'my-query-kill-current-buffer