From 67213f6da8cd02ed0a9290ca002a38411d446b6b Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 25 Nov 2016 10:29:12 +0100 Subject: [PATCH] Create command kill-this-buffer-delet-this-window It kill the current buffer and deletes the window. --- init.el | 1 + lisp/window-manip.el | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/init.el b/init.el index ff1e268..04b0492 100644 --- a/init.el +++ b/init.el @@ -1064,6 +1064,7 @@ ("~" . toggle-char-case) ("|" . toggle-window-split) ("k" . gpolonkai/kill-this-buffer) + ("M-c" . gpolonkai/kill-this-buffer-delete-this-window) ("M-k" . gpolonkai/undo-buffer-kill) :map isearch-mode-map ("" . isearch-exit-other-end) diff --git a/lisp/window-manip.el b/lisp/window-manip.el index ad6ad79..cebe9c9 100644 --- a/lisp/window-manip.el +++ b/lisp/window-manip.el @@ -54,3 +54,10 @@ "Quit WINDOW without killing it." (interactive) (quit-window nil window)) + +(defun gpolonkai/kill-this-buffer-delete-this-window () + "Kill the buffer in the current window, and then try to delete +the current window." + (interactive) + (kill-this-buffer) + (delete-window))