mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
(kill-buffer-and-window): New command.
Bind it to C-x 4 0.
This commit is contained in:
parent
44d7776b5b
commit
b691df0c08
1 changed files with 11 additions and 1 deletions
|
|
@ -277,12 +277,22 @@ or if the window is the only window of its frame."
|
|||
;; Make sure we unbind buffer-read-only
|
||||
;; with the proper current buffer.
|
||||
(set-buffer buffer))))))
|
||||
|
||||
|
||||
(defun kill-buffer-and-window ()
|
||||
"Kill the current buffer and delete the selected window."
|
||||
(interactive)
|
||||
(if (yes-or-no-p (format "Kill buffer `%s'? " (buffer-name)))
|
||||
(let ((buffer (current-buffer)))
|
||||
(delete-window (selected-window))
|
||||
(kill-buffer buffer))
|
||||
(error "Aborted")))
|
||||
|
||||
(define-key ctl-x-map "2" 'split-window-vertically)
|
||||
(define-key ctl-x-map "3" 'split-window-horizontally)
|
||||
(define-key ctl-x-map "}" 'enlarge-window-horizontally)
|
||||
(define-key ctl-x-map "{" 'shrink-window-horizontally)
|
||||
(define-key ctl-x-map "-" 'shrink-window-if-larger-than-buffer)
|
||||
(define-key ctl-x-map "+" 'balance-windows)
|
||||
(define-key ctl-x-4-map "0" 'kill-buffer-and-window)
|
||||
|
||||
;;; windows.el ends here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue