From: Taylor R. Campbell Date: Mon, 2 Jan 2006 04:20:59 +0000 (+0000) Subject: Implement KILL-BUFFER-AND-WINDOW command (C-x 4 0) as in GNU Emacs. X-Git-Tag: 20090517-FFI~1139 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=64e0456115ba1e977940d2676f41f1f91f0949d7;p=mit-scheme.git Implement KILL-BUFFER-AND-WINDOW command (C-x 4 0) as in GNU Emacs. --- diff --git a/v7/src/edwin/modefs.scm b/v7/src/edwin/modefs.scm index fb580ed2d..6ca4da513 100644 --- a/v7/src/edwin/modefs.scm +++ b/v7/src/edwin/modefs.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: modefs.scm,v 1.166 2004/01/16 19:11:09 cph Exp $ +$Id: modefs.scm,v 1.167 2006/01/02 04:20:59 riastradh Exp $ Copyright 1987,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1998,1999,2000 Massachusetts Institute of Technology @@ -273,6 +273,7 @@ Like Fundamental mode, but no self-inserting characters.") (define-key 'fundamental '(#\c-x #\2) 'split-window-vertically) (define-key 'fundamental '(#\c-x #\3) 'split-window-horizontally) (define-prefix-key 'fundamental '(#\c-x #\4)) +(define-key 'fundamental '(#\C-x #\4 #\0) 'kill-buffer-and-window) (define-key 'fundamental '(#\c-x #\4 #\c-f) 'find-file-other-window) (define-key 'fundamental '(#\c-x #\4 #\.) 'find-tag-other-window) (define-key 'fundamental '(#\c-x #\4 #\b) 'switch-to-buffer-other-window) diff --git a/v7/src/edwin/wincom.scm b/v7/src/edwin/wincom.scm index b63f4421a..8e93502c0 100644 --- a/v7/src/edwin/wincom.scm +++ b/v7/src/edwin/wincom.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: wincom.scm,v 1.135 2003/02/14 18:28:14 cph Exp $ +$Id: wincom.scm,v 1.136 2006/01/02 04:20:59 riastradh Exp $ Copyright 1987, 1989-2000 Massachusetts Institute of Technology @@ -335,6 +335,13 @@ or if the window is the only window of its frame." () (lambda () (delete-other-windows (selected-window)))) +(define-command kill-buffer-and-window + "Kill the current buffer and delete the window it was in." + () + (lambda () + (kill-buffer-interactive (current-buffer)) + (window-delete! (selected-window)))) + (define-command other-window "Select the ARG'th different window." "p"