From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Joakim Hove Newsgroups: gmane.emacs.help Subject: Re: resize remaining buffer after kill buffer Supersedes: <4yfzk88jcv.fsf@skjellgran.ii.uib.no> Date: Mon, 11 Aug 2003 14:34:33 +0200 Organization: University of Bergen Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <4yd6fc8jae.fsf@skjellgran.ii.uib.no> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1060606260 9744 80.91.224.253 (11 Aug 2003 12:51:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2003 12:51:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 14:50:59 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19mC8Z-0001Nb-00 for ; Mon, 11 Aug 2003 14:50:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19mC52-0003yZ-1o for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2003 08:47:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!tethys.csu.net!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!205.188.226.98!ngpeer.news.aol.com!newsfeed1!bredband!uio.no!nntp.uib.no!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: skjellgran.ii.uib.no Original-X-Trace: toralf.uib.no 1060605273 91725 129.177.20.52 (11 Aug 2003 12:34:33 GMT) Original-X-Complaints-To: abuse@uib.no Original-NNTP-Posting-Date: 11 Aug 2003 12:34:33 GMT User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (gnu/linux) Cancel-Key: sha1:Y9i3eCyqO11dOWbj0xXeVfJ7JjI= Cancel-Lock: sha1:3LcuVIk5WglHsVnWM20H0X7rxiI= Original-Xref: shelby.stanford.edu gnu.emacs.help:115797 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11716 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11716 Homunkulus@gmx.net (Torsten Müller) writes: > Is there any simple way to enlarge one of the remaining buffers by the > size of the just killed buffer? Hello, I don't know if this is what you want but: (defun kill-buffer-and-window (BUFFER) "Kills a buffer and the accompanying window. If the buffer is not displayed in the active frame nothing happens to the window configuration" (interactive "bKill buffer:") (let ((window)) (if (> (count-windows) 1) (setq window (get-buffer-window BUFFER))) (kill-buffer BUFFER) (if window (delete-window window)))) does something alike. *Warning* After writing this function I discovered that there already exists a built in function with the same name, however It seems the built function does not allow you to select which buffer to kill. In my implementation nothing happens if you kill a buffer which does not occupy a window in the current frame. Joakim -- /--------------------------------------------------------------------\ / Joakim Hove / hove@bccs.no / (55 5) 84076 | \ | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 | | CMU | 5231 Paradis | \ Thormøhlensgt.55, 5020 Bergen. | 55 91 28 18 / \--------------------------------------------------------------------/