From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#1259: quit-window: does it quit the wrong buffer? Date: Tue, 04 Nov 2008 19:15:40 +0100 Message-ID: <4910914C.3070009@gmx.at> References: <49059893.3020006@gmx.at> <4757158C-5312-498F-94C6-7A34C0BEFC59@gmail.com> <4905F558.7070005@gmx.at> <4727ECB9-A38C-4717-AFE5-2CED845C1C50@gmail.com> Reply-To: martin rudalics , 1259@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1225823446 11864 80.91.229.12 (4 Nov 2008 18:30:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Nov 2008 18:30:46 +0000 (UTC) Cc: 1259@emacsbugs.donarmstrong.com To: David Reitter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 04 19:31:48 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KxQgr-00075Q-Lx for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Nov 2008 19:31:46 +0100 Original-Received: from localhost ([127.0.0.1]:43131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxQfj-0001FT-I7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Nov 2008 13:30:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KxQfM-00014R-55 for bug-gnu-emacs@gnu.org; Tue, 04 Nov 2008 13:30:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KxQfK-00013d-AB for bug-gnu-emacs@gnu.org; Tue, 04 Nov 2008 13:30:11 -0500 Original-Received: from [199.232.76.173] (port=50470 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxQfK-00013V-2C for bug-gnu-emacs@gnu.org; Tue, 04 Nov 2008 13:30:10 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60246) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KxQfK-0004bJ-4q for bug-gnu-emacs@gnu.org; Tue, 04 Nov 2008 13:30:10 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mA4IU5Rd031446; Tue, 4 Nov 2008 10:30:05 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mA4IP4NI030179; Tue, 4 Nov 2008 10:25:04 -0800 X-Loop: don@donarmstrong.com Resent-From: martin rudalics Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 04 Nov 2008 18:25:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122582281830031 (code B ref 1259); Tue, 04 Nov 2008 18:25:04 +0000 Original-Received: (at 1259) by emacsbugs.donarmstrong.com; 4 Nov 2008 18:20:18 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id mA4IKBCY029173 for <1259@emacsbugs.donarmstrong.com>; Tue, 4 Nov 2008 10:20:14 -0800 Original-Received: (qmail invoked by alias); 04 Nov 2008 18:20:05 -0000 Original-Received: from 88-117-44-206.adsl.highway.telekom.at (EHLO [88.117.44.206]) [88.117.44.206] by mail.gmx.net (mp036) with SMTP; 04 Nov 2008 19:20:05 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+z5i02+Amzbkx+n/6qPAL+wDg69X2TyTj/0E/RK+ DX3JO31aFHkK1Y User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <4727ECB9-A38C-4717-AFE5-2CED845C1C50@gmail.com> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.67 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 04 Nov 2008 13:30:11 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:22162 Archived-At: > Is there a reason why you're not calling delete-window-on in all cases? Just for the case that I have two windows showing the same buffer and invoke `quit-window' on one of them. In this case I want to leave the other window alone. (BTW, using `delete-windows-on' for a frame showing _one_ window is a kludge - but `delete-windows-on' is the only function I found that handles some corner cases in this area correctly.) > Why the condition-case only for delete-window? I don't think it's needed. But delete_window has a strange loop I never understood completely which can err with "Cannot delete window" and I wanted to avoid that. > Also, why the explicit switch-to-buffer? > Should quit-window switch to the buffer that would be displayed if the > current buffer was killed or just buried? That was already in the old version of `quit-window'. Note that when WINDOW is not the selected window, `bury-buffer' leaves the buffer displayed in WINDOW. `quit-window' must remove the buffer from WINDOW even if WINDOW is not selected. In any case, don't expect too much from `quit-window'. The underlying logic is too weak to make it more useful. What we really need is a buffer-local variable say `quit-windows-on' which, when set, triggers some special code in `set-window-buffer' and `display-buffer'. The former would simply record in a window-local variable `how-to-quit' the buffer formerly displayed in the window and `quit-window' could switch to that buffer, provided its still live. `display-buffer' would do the same but in addition, when it splits a window to display the buffer, set `how-to-quit' to t so `quit-window' could eventually delete that window. A similar solution would have `quit-window' delete a stand-alone frame popped up by `display-buffer'. Most of this has been implemented in Lisp in some form or the other but that's not sufficient. `set-window-buffer' must act on this. martin