From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window: does it quit the wrong buffer? Reply-To: David Reitter , 1259@debbugs.gnu.org Resent-From: David Reitter Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 27 Oct 2008 01:30:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122507040623068 (code B ref -1); Mon, 27 Oct 2008 01:30:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.4 required=4.0 tests=AWL,BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 27 Oct 2008 01:20:06 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9R1K2XS022866 for ; Sun, 26 Oct 2008 18:20:03 -0700 Received: from mail.gnu.org ([199.232.76.166]:60905 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KuGjK-0002T4-N5 for emacs-pretest-bug@gnu.org; Sun, 26 Oct 2008 21:17:14 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KuGm0-0008OV-6G for emacs-pretest-bug@gnu.org; Sun, 26 Oct 2008 21:20:00 -0400 Received: from ug-out-1314.google.com ([66.249.92.171]:20165) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KuGlz-0008ND-NO for emacs-pretest-bug@gnu.org; Sun, 26 Oct 2008 21:20:00 -0400 Received: by ug-out-1314.google.com with SMTP id 36so152286uga.17 for ; Sun, 26 Oct 2008 18:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=NBT7mAW/hcseEVbSIS7QyKkd63E5mcxaYSOcMI/DmYk=; b=Z56IgpXKQY/WYCCeP+BprvkbcsrgyPUw9Ag6AfYFFqy4wTxIwA/JwpzQ7EKYgJHmGp Pau2YgrR+nIi4McYKWjNUsFT9Ph8qEEE+ailGOjPO5zbrkRIBAoqhbRmp0k2klm4AxsU uiWjqYfr7x6Oqbst6JAytksJ23DrOhDjeHO58= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=ez+c6/rJpLsqjrPQ2FEjxu3clLSjzloRuSgmoOzGV+QiH2EzUrZub1W5gpAKCO2SrC dfihoSgNPCW9usJe9vwiqPPbDsJcSOySK3IDBvE0P5FSvbPSX6gnT6zGnUdaNp6NzfHG 7a8bW2efYTf1m+lEXQNcfVv0B1PS1qYJPgxsc= Received: by 10.66.218.15 with SMTP id q15mr1716283ugg.77.1225070392707; Sun, 26 Oct 2008 18:19:52 -0700 (PDT) Received: from ?10.0.1.2? (pool-151-201-18-130.pitt.east.verizon.net [151.201.18.130]) by mx.google.com with ESMTPS id w28sm1358599uge.5.2008.10.26.18.19.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 26 Oct 2008 18:19:51 -0700 (PDT) Message-Id: From: David Reitter To: emacs-pretest-bug@gnu.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Sun, 26 Oct 2008 21:19:48 -0400 X-Mailer: Apple Mail (2.929.2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) I'm wondering if there is a discrepancy between the doc string of quit- window and its implementation: The function is supposed to quit the current buffer, but what it seems to do is to quit the buffer in the selected window. (defun quit-window (&optional kill window) "Quit the current buffer. Bury it, and maybe delete the selected frame. \(The frame is deleted if it contains a dedicated window for the buffer.) With a prefix argument, kill the buffer instead. Noninteractively, if KILL is non-nil, then kill the current buffer, otherwise bury it. If WINDOW is non-nil, it specifies a window; we delete that window, and the buffer that is killed or buried is the one in that window." (interactive "P") (let ((buffer (window-buffer window)) (frame (window-frame (or window (selected-window)))) From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window: does it quit the wrong buffer? Reply-To: martin rudalics , 1259@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 27 Oct 2008 10:40:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122510362029734 (code B ref 1259); Mon, 27 Oct 2008 10:40:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.6 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 27 Oct 2008 10:33:40 +0000 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 m9RAXacc029727 for <1259@emacsbugs.donarmstrong.com>; Mon, 27 Oct 2008 03:33:37 -0700 Received: (qmail invoked by alias); 27 Oct 2008 10:33:29 -0000 Received: from 62-47-42-130.adsl.highway.telekom.at (EHLO [62.47.42.130]) [62.47.42.130] by mail.gmx.net (mp048) with SMTP; 27 Oct 2008 11:33:29 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/l/UJZ7CvlleXgQHCUSuzw+qL+EgXzJVXn5+yxeI WIkrc/1sfY1bUD Message-ID: <49059893.3020006@gmx.at> Date: Mon, 27 Oct 2008 11:31:47 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: David Reitter CC: 1259@debbugs.gnu.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.64 > I'm wondering if there is a discrepancy between the doc string of > quit-window and its implementation: The function is supposed to quit > the current buffer, but what it seems to do is to quit the buffer in the > selected window. You're right. The doc-string is wrong in other respects as well. Does the form below fit your needs? martin (defun quit-window (&optional kill window) "Bury or kill (with KILL non-nil) the buffer displayed in WINDOW. KILL defaults to nil, WINDOW to the selected window. If WINDOW is dedicated and the only window on its frame, delete its frame provided there are other frames left." (interactive) (let* ((window (or window (selected-window))) (buffer (window-buffer window)) (frame (window-frame window)) window-solitary window-handled) (with-selected-window window (setq window-solitary (one-window-p t)) (unless (or (window-minibuffer-p) (window-dedicated-p)) (switch-to-buffer (other-buffer)))) ;; Get rid of the frame, if it has just one dedicated window ;; and other visible frames exist. (when (and (or (window-minibuffer-p window) (window-dedicated-p window)) window-solitary (frame-visible-p frame)) (unless (and (eq default-minibuffer-frame frame) (= 1 (length (minibuffer-frame-list)))) (delete-frame frame)) (setq window-handled t)) ;; Deal with the buffer. (if kill (kill-buffer buffer) (bury-buffer buffer)) ;; Maybe get rid of the window. (when (and (not window-handled) (not window-solitary)) (delete-window window)))) From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window: does it quit the wrong buffer? Reply-To: David Reitter , 1259@debbugs.gnu.org Resent-From: David Reitter Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 27 Oct 2008 15:10: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: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122511971631779 (code B ref 1259); Mon, 27 Oct 2008 15:10:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.8 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 27 Oct 2008 15:01:56 +0000 Received: from mail-gx0-f15.google.com (mail-gx0-f15.google.com [209.85.217.15]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9RF1lIS031773 for <1259@emacsbugs.donarmstrong.com>; Mon, 27 Oct 2008 08:01:48 -0700 Received: by gxk8 with SMTP id 8so2476443gxk.1 for <1259@emacsbugs.donarmstrong.com>; Mon, 27 Oct 2008 08:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=zBriR1Ygdyrog/nMKPn87VtmBx2hlRJ2DtA18b1rsYI=; b=kGy0ssh5wdbLQwvlusLHTV1OnN0Pk26nTkTW8WGZaNkPT8ApciJsncbC/gOu15r3/b d1MJTjxhPfycruiYoBmWTqcOxCxN6YbsTvtbVtZHMyPNm9jhlRzGP2Ntu8i/1YxomvCZ xHbT3xep4WzpxYObvN4Br1QDtF1Mb9lbUaqHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=WE8pWArS/kiOS7eLX8kEE9SmomcJoBYIO5JLOZy2+aTn1dzQM/VfgN6wv9ndgUHiX8 OxOYMpkR7I+F3pFYAeqTQgcS0jWQRpvxZ1Gtm8rgSDZQPd/0VnF/5usXzUjzDsTMm4Y/ kKYubKaY+2S5SFIb50MqtBi6E5TWnl4c9Wfog= Received: by 10.90.100.17 with SMTP id x17mr4775682agb.11.1225119701921; Mon, 27 Oct 2008 08:01:41 -0700 (PDT) Received: from SCARLETT.PSY.CMU.EDU (SCARLETT.PSY.CMU.EDU [128.2.249.106]) by mx.google.com with ESMTPS id 30sm20554hso.3.2008.10.27.08.01.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Oct 2008 08:01:41 -0700 (PDT) Cc: 1259@debbugs.gnu.org Message-Id: <4757158C-5312-498F-94C6-7A34C0BEFC59@gmail.com> From: David Reitter To: martin rudalics In-Reply-To: <49059893.3020006@gmx.at> Content-Type: multipart/signed; boundary=Apple-Mail-17--148119709; micalg=sha1; protocol="application/pkcs7-signature" Mime-Version: 1.0 (Apple Message framework v929.2) Date: Mon, 27 Oct 2008 11:01:39 -0400 References: <49059893.3020006@gmx.at> X-Mailer: Apple Mail (2.929.2) --Apple-Mail-17--148119709 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On 27 Oct 2008, at 06:31, martin rudalics wrote: > > I'm wondering if there is a discrepancy between the doc string of > > quit-window and its implementation: The function is supposed to > quit > > the current buffer, but what it seems to do is to quit the buffer > in the > > selected window. > > You're right. The doc-string is wrong in other respects as well. > Does > the form below fit your needs? The doc string you sent seems appropriate to me, thanks. --Apple-Mail-17--148119709 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIFxDCCAn0w ggHmoAMCAQICEEfSZyInpN9bVdFPsdICbiIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAo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vcN AQkFMQ8XDTA4MTAyNzE1MDE0MFowIwYJKoZIhvcNAQkEMRYEFEW1hfTut3FU4b+usfGr5fZRGPCw MIGFBgkrBgEEAYI3EAQxeDB2MGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3dGUgQ29uc3Vs dGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1haWwgSXNzdWlu ZyBDQQIQR9JnIiek31tV0U+x0gJuIjCBhwYLKoZIhvcNAQkQAgsxeKB2MGIxCzAJBgNVBAYTAlpB MSUwIwYDVQQKExxUaGF3dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUg UGVyc29uYWwgRnJlZW1haWwgSXNzdWluZyBDQQIQR9JnIiek31tV0U+x0gJuIjANBgkqhkiG9w0B AQEFAASBgB4IoflwAK5GlTGzSmO4hSKsPK9cx+7GqYD4IF79m6KT1TwTGd6GbfrYMETYim9frbjK xC6bkmw4Yh5AHE3WN70JKTcbMIV6OWK4/jIpyholLek5LZu9SdiqHzh8l8z1gBqXSnDj/ueNcUEP 4wAmpk0CMi2J9BiStQof0PUkmZx3AAAAAAAA --Apple-Mail-17--148119709-- From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window: does it quit the wrong buffer? Reply-To: martin rudalics , 1259@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 27 Oct 2008 17:15:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122512739630881 (code B ref 1259); Mon, 27 Oct 2008 17:15:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.6 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,MURPHY_SEX_L4 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 27 Oct 2008 17:09:56 +0000 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 m9RH9pEH030875 for <1259@emacsbugs.donarmstrong.com>; Mon, 27 Oct 2008 10:09:52 -0700 Received: (qmail invoked by alias); 27 Oct 2008 17:09:44 -0000 Received: from 62-47-42-103.adsl.highway.telekom.at (EHLO [62.47.42.103]) [62.47.42.103] by mail.gmx.net (mp006) with SMTP; 27 Oct 2008 18:09:44 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX189hx9Yl5k9s3IDn9jpqK2h/6os/qzQQunQjn99jk XeEZrkzVzGWNKb Message-ID: <4905F558.7070005@gmx.at> Date: Mon, 27 Oct 2008 18:07:36 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: David Reitter CC: 1259@debbugs.gnu.org References: <49059893.3020006@gmx.at> <4757158C-5312-498F-94C6-7A34C0BEFC59@gmail.com> In-Reply-To: <4757158C-5312-498F-94C6-7A34C0BEFC59@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.65 `quit-window' looks fishy in a number of regards: The `delete-frame' stuff needs other_visible_frames to work correctly but this is not available in Elisp. I plan to commit somthing like the version below. Could people please test whether it breaks their favorite use of this? martin (defun quit-window (&optional kill window) "Bury or kill (with KILL non-nil) the buffer displayed in WINDOW. KILL defaults to nil, WINDOW to the selected window. If WINDOW is dedicated or a minibuffer window, delete it and, if it's the only window on its frame, delete its frame as well provided there are other frames left. Otherwise, display some other buffer in the window." (interactive) (let* ((window (or window (selected-window))) (buffer (window-buffer window))) (if (or (window-minibuffer-p window) (window-dedicated-p window)) (if (eq window (frame-root-window (window-frame window))) ;; If this is the only window on its frame, try to delete the ;; frame (`delete-windows-on' knows how to do that). (delete-windows-on buffer (selected-frame)) ;; Other windows are left, delete this window. But don't ;; throw an error if that fails for some reason. (condition-case nil (delete-window window) (error nil))) ;; The window is neither dedicated nor a minibuffer window, ;; display another buffer in it. (with-selected-window window (switch-to-buffer (other-buffer)))) ;; Deal with the buffer. (if kill (kill-buffer buffer) (bury-buffer buffer)))) From unknown Sun Sep 21 06:36:28 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: David Reitter Subject: bug#1259 closed by martin rudalics (Re: bug#1259: quit-window: does it quit the wrong buffer?) Message-ID: References: <4909D5D9.60300@gmx.at> X-Emacs-PR-Message: they-closed 1259 X-Emacs-PR-Package: emacs Reply-To: 1259@debbugs.gnu.org Content-Type: multipart/mixed; boundary="----------=_1225381803-25410-1" This is a multi-part message in MIME format... ------------=_1225381803-25410-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #1259: quit-window: does it quit the wrong buffer? It has been closed by martin rudalics . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact martin rudalics by replying to this email. --=20 1259: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D1259 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1225381803-25410-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From rudalics@gmx.at Thu Oct 30 08:43:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259-done) by emacsbugs.donarmstrong.com; 30 Oct 2008 15:43:37 +0000 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 m9UFhW2U024162 for <1259-done@emacsbugs.donarmstrong.com>; Thu, 30 Oct 2008 08:43:34 -0700 Received: (qmail invoked by alias); 30 Oct 2008 15:43:26 -0000 Received: from 62-47-39-58.adsl.highway.telekom.at (EHLO [62.47.39.58]) [62.47.39.58] by mail.gmx.net (mp004) with SMTP; 30 Oct 2008 16:43:26 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/cuBoaFZPcENE/E0Dw0T1dx1iSuLde7f20I1Qn4t 0Spy5WRCqwrC3S Message-ID: <4909D5D9.60300@gmx.at> Date: Thu, 30 Oct 2008 16:42:17 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: 1259-done@debbugs.gnu.org CC: David Reitter Subject: Re: bug#1259: quit-window: does it quit the wrong buffer? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.71 Fixed as 2008-10-30 Martin Rudalics * window.el (quit-window): Simplify code. Say in doc-string that it operates on the selected window's buffer. (Bug#1259) Thanks, martin ------------=_1225381803-25410-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From david.reitter@gmail.com Sun Oct 26 18:20:06 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.4 required=4.0 tests=AWL,BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 27 Oct 2008 01:20:06 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9R1K2XS022866 for ; Sun, 26 Oct 2008 18:20:03 -0700 Received: from mail.gnu.org ([199.232.76.166]:60905 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KuGjK-0002T4-N5 for emacs-pretest-bug@gnu.org; Sun, 26 Oct 2008 21:17:14 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KuGm0-0008OV-6G for emacs-pretest-bug@gnu.org; Sun, 26 Oct 2008 21:20:00 -0400 Received: from ug-out-1314.google.com ([66.249.92.171]:20165) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KuGlz-0008ND-NO for emacs-pretest-bug@gnu.org; Sun, 26 Oct 2008 21:20:00 -0400 Received: by ug-out-1314.google.com with SMTP id 36so152286uga.17 for ; Sun, 26 Oct 2008 18:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=NBT7mAW/hcseEVbSIS7QyKkd63E5mcxaYSOcMI/DmYk=; b=Z56IgpXKQY/WYCCeP+BprvkbcsrgyPUw9Ag6AfYFFqy4wTxIwA/JwpzQ7EKYgJHmGp Pau2YgrR+nIi4McYKWjNUsFT9Ph8qEEE+ailGOjPO5zbrkRIBAoqhbRmp0k2klm4AxsU uiWjqYfr7x6Oqbst6JAytksJ23DrOhDjeHO58= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=ez+c6/rJpLsqjrPQ2FEjxu3clLSjzloRuSgmoOzGV+QiH2EzUrZub1W5gpAKCO2SrC dfihoSgNPCW9usJe9vwiqPPbDsJcSOySK3IDBvE0P5FSvbPSX6gnT6zGnUdaNp6NzfHG 7a8bW2efYTf1m+lEXQNcfVv0B1PS1qYJPgxsc= Received: by 10.66.218.15 with SMTP id q15mr1716283ugg.77.1225070392707; Sun, 26 Oct 2008 18:19:52 -0700 (PDT) Received: from ?10.0.1.2? (pool-151-201-18-130.pitt.east.verizon.net [151.201.18.130]) by mx.google.com with ESMTPS id w28sm1358599uge.5.2008.10.26.18.19.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 26 Oct 2008 18:19:51 -0700 (PDT) Message-Id: From: David Reitter To: emacs-pretest-bug@gnu.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: quit-window: does it quit the wrong buffer? Date: Sun, 26 Oct 2008 21:19:48 -0400 X-Mailer: Apple Mail (2.929.2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) I'm wondering if there is a discrepancy between the doc string of quit- window and its implementation: The function is supposed to quit the current buffer, but what it seems to do is to quit the buffer in the selected window. (defun quit-window (&optional kill window) "Quit the current buffer. Bury it, and maybe delete the selected frame. \(The frame is deleted if it contains a dedicated window for the buffer.) With a prefix argument, kill the buffer instead. Noninteractively, if KILL is non-nil, then kill the current buffer, otherwise bury it. If WINDOW is non-nil, it specifies a window; we delete that window, and the buffer that is killed or buried is the one in that window." (interactive "P") (let ((buffer (window-buffer window)) (frame (window-frame (or window (selected-window)))) ------------=_1225381803-25410-1-- From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window: does it quit the wrong buffer? Reply-To: David Reitter , 1259@debbugs.gnu.org Resent-From: David Reitter Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 04 Nov 2008 17:50:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122582045519840 (code B ref 1259); Tue, 04 Nov 2008 17:50:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,MURPHY_SEX_L4 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 4 Nov 2008 17:40:55 +0000 Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.191]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mA4HeqhN019834 for <1259@emacsbugs.donarmstrong.com>; Tue, 4 Nov 2008 09:40:53 -0800 Received: by rn-out-0910.google.com with SMTP id j66so2484790rne.20 for <1259@emacsbugs.donarmstrong.com>; Tue, 04 Nov 2008 09:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=pQENMdb/K/7NXGZ5B+bgh/MPPYQuzz6bYaqIquM8Mac=; b=gO4bef+fZ03PWy9iHO5/CHfZB56S7i4aI7IaacefD00b75/jA/Q5JCrV24Y032HSX5 xT4+nTW21nAkYkS9ylLKemaNRd32nxmxlF+Qx22LnmpnqgrlCot9yoYBaQk7Aa3uoEPC orF2OQMahOwceSaopz6SQ+nz3M7oQRiTdTdEQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=icaX/VJncfGwIGuo5uJMB6qSjFvKSNWAZttcaz7sJWUDLWKawzbIkirm700SYcrukM NAoY9C80gTwLCSKhmGOU8Q77u0gq3tBNhCRFYqM7rsQQMcahu61WurtvTQKuoa3qWLK1 GZdAFruqL2UXPHI2P/IcAOO0AU+GhTXwM6GDw= Received: by 10.100.46.10 with SMTP id t10mr870174ant.136.1225820451670; Tue, 04 Nov 2008 09:40:51 -0800 (PST) Received: from SCARLETT.PSY.CMU.EDU (SCARLETT.PSY.CMU.EDU [128.2.249.106]) by mx.google.com with ESMTPS id d24sm1046218and.4.2008.11.04.09.40.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Nov 2008 09:40:50 -0800 (PST) Cc: 1259@debbugs.gnu.org Message-Id: <4727ECB9-A38C-4717-AFE5-2CED845C1C50@gmail.com> From: David Reitter To: martin rudalics In-Reply-To: <4905F558.7070005@gmx.at> Content-Type: multipart/signed; boundary=Apple-Mail-100-552628433; micalg=sha1; protocol="application/pkcs7-signature" Mime-Version: 1.0 (Apple Message framework v929.2) Date: Tue, 4 Nov 2008 12:40:47 -0500 References: <49059893.3020006@gmx.at> <4757158C-5312-498F-94C6-7A34C0BEFC59@gmail.com> <4905F558.7070005@gmx.at> X-Mailer: Apple Mail (2.929.2) --Apple-Mail-100-552628433 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Sorry for the delay. On 27 Oct 2008, at 13:07, martin rudalics wrote: > `quit-window' looks fishy in a number of regards: The `delete-frame' > stuff needs other_visible_frames to work correctly but this is not > available in Elisp. I plan to commit somthing like the version below. > Could people please test whether it breaks their favorite use of this? Is there a reason why you're not calling delete-window-on in all cases? Why the condition-case only for delete-window? 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? - David > > > (defun quit-window (&optional kill window) > "Bury or kill (with KILL non-nil) the buffer displayed in WINDOW. > KILL defaults to nil, WINDOW to the selected window. If WINDOW > is dedicated or a minibuffer window, delete it and, if it's the > only window on its frame, delete its frame as well provided there > are other frames left. Otherwise, display some other buffer in > the window." > (interactive) > (let* ((window (or window (selected-window))) > (buffer (window-buffer window))) > (if (or (window-minibuffer-p window) (window-dedicated-p window)) > (if (eq window (frame-root-window (window-frame window))) > ;; If this is the only window on its frame, try to delete the > ;; frame (`delete-windows-on' knows how to do that). > (delete-windows-on buffer (selected-frame)) > ;; Other windows are left, delete this window. But don't > ;; throw an error if that fails for some reason. > (condition-case nil > (delete-window window) > (error nil))) > ;; The window is neither dedicated nor a minibuffer window, > ;; display another buffer in it. > (with-selected-window window > (switch-to-buffer (other-buffer)))) > > ;; Deal with the buffer. > (if kill > (kill-buffer buffer) > (bury-buffer buffer)))) > --Apple-Mail-100-552628433 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIFxDCCAn0w ggHmoAMCAQICEEfSZyInpN9bVdFPsdICbiIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA3MTIwOTIzMDM0OFoXDTA4MTIwODIzMDM0 OFowYjEQMA4GA1UEBBMHUmVpdHRlcjEOMAwGA1UEKhMFRGF2aWQxFjAUBgNVBAMTDURhdmlkIFJl aXR0ZXIxJjAkBgkqhkiG9w0BCQEWF2RhdmlkLnJlaXR0ZXJAZ21haWwuY29tMIGfMA0GCSqGSIb3 DQEBAQUAA4GNADCBiQKBgQDIS4kZGULD+CxprkxDnEccAnZ2GQQxfn55aiAPoy5kJ+uLhelaZP4p lgx3Vq8xYK1bjsLepGYp8qzVlHsyQPb6OfvRzrUXHxlJrHME0+Lblx37PBLxGDxc5W8qfZFJpej8 Dk3LUMga8laR9CRghbALoTV3UThUSMqk1cVwTY99KQIDAQABozQwMjAiBgNVHREEGzAZgRdkYXZp ZC5yZWl0dG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UWTwklOB/5pMPg6kv3HDE0hO4N9V82SDJ9ZVsEBM5a1Tespf8rC/WL+Q2ERuz1XfNYvKuHfaz4R sLChOy7VZYd7lRRT0+g7/9JpFQCvAAAAAAAA --Apple-Mail-100-552628433-- From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window: does it quit the wrong buffer? Reply-To: martin rudalics , 1259@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.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: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122582281830031 (code B ref 1259); Tue, 04 Nov 2008 18:25:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.0 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 4 Nov 2008 18:20:18 +0000 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 Received: (qmail invoked by alias); 04 Nov 2008 18:20:05 -0000 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 Message-ID: <4910914C.3070009@gmx.at> Date: Tue, 04 Nov 2008 19:15:40 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: David Reitter CC: 1259@debbugs.gnu.org References: <49059893.3020006@gmx.at> <4757158C-5312-498F-94C6-7A34C0BEFC59@gmail.com> <4905F558.7070005@gmx.at> <4727ECB9-A38C-4717-AFE5-2CED845C1C50@gmail.com> In-Reply-To: <4727ECB9-A38C-4717-AFE5-2CED845C1C50@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.67 > 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 From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: "Juanma Barranquero" , 1259@debbugs.gnu.org Resent-From: "Juanma Barranquero" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 13 Nov 2008 16:50:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122659445813942 (code B ref 1259); Thu, 13 Nov 2008 16:50:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.1 required=4.0 tests=AWL,BAYES_00,MURPHY_SEX_L4 autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 13 Nov 2008 16:40:58 +0000 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mADGetqR013936 for <1259@emacsbugs.donarmstrong.com>; Thu, 13 Nov 2008 08:40:56 -0800 Received: by yx-out-2324.google.com with SMTP id 8so443893yxg.31 for <1259@emacsbugs.donarmstrong.com>; Thu, 13 Nov 2008 08:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:mime-version:content-type:content-transfer-encoding :content-disposition; bh=jt+dIW3wf2k+xH75Y+NA3M96JCi7bvbSDuG6VH4c0HI=; b=DNliJ6RJbHqvkaCWhs6ZciLgWihhN+5yfPdQKrZ+80rE6TD8DhfNclPWsZpK1pt2tk NoglDZipqwqG71tU9+y33OhqaRjU19a3K72l5E7C97c/xA5INnGLPE2EmgAvNFRQzQqH FogbW6P40KSWGaBqcjuKaoDf1zJWUGWcmLTMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type :content-transfer-encoding:content-disposition; b=oIBq47LSqk7NXM3Rmv0xmvq+tzMzIyxpP4LVXIk1u3vfQkrKSdgPSaYco7a8JrbC6R PxJpzfo0XO1KRvau2FFaq/IUFX+rFyIk6IHFpqh7noMDCNlTvkDn3MO3Izj2/OldN1rN +7SFnmJMICNocgP9pI/Nrwfdy+qC6NDv9egHs= Received: by 10.100.140.15 with SMTP id n15mr4792758and.111.1226594455072; Thu, 13 Nov 2008 08:40:55 -0800 (PST) Received: by 10.100.13.13 with HTTP; Thu, 13 Nov 2008 08:40:55 -0800 (PST) Message-ID: Date: Thu, 13 Nov 2008 17:40:55 +0100 From: "Juanma Barranquero" To: "martin rudalics" Cc: 1259@debbugs.gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Martin, I'm afraid I missed this comment by you: "`quit-window' looks fishy in a number of regards: The `delete-frame' stuff needs other_visible_frames to work correctly but this is not available in Elisp. I plan to commit somthing like the version below. Could people please test whether it breaks their favorite use of this?" But yes, it breaks one of my favorite uses. The docstring previously said: "If WINDOW is non-nil, it specifies a window; we delete that window, and the buffer that is killed or buried is the one in that window." Now, it says: "If WINDOW is dedicated or a minibuffer window, delete it and, if it's the only window on its frame, delete its frame as well provided there are other frames left. Otherwise, display some other buffer in the window." I was using the previously documented behavior. I have a function (defun quit-buffer-and-window () (interactive) (quit-window nil (selected-window))) (I assign it to "q" in many modes). Now, C-x 2 C-x o M-x quit-buffer-and-window leaves me with two windows. Juanma From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: martin rudalics , 1259@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 14 Nov 2008 08:15:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122665014312755 (code B ref 1259); Fri, 14 Nov 2008 08:15:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.2 required=4.0 tests=AWL,BAYES_00,FOURLA autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 14 Nov 2008 08:09:03 +0000 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 mAE88xRi012738 for <1259@emacsbugs.donarmstrong.com>; Fri, 14 Nov 2008 00:09:00 -0800 Received: (qmail invoked by alias); 14 Nov 2008 08:08:52 -0000 Received: from 62-47-54-118.adsl.highway.telekom.at (EHLO [62.47.54.118]) [62.47.54.118] by mail.gmx.net (mp035) with SMTP; 14 Nov 2008 09:08:52 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18zdYZiA0AzPTZSevmSS8BIbaHNEdKaMun5RHJGA4 X6mSGzE7YOGN2h Message-ID: <491D318C.80402@gmx.at> Date: Fri, 14 Nov 2008 09:06:36 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Juanma Barranquero CC: 1259@debbugs.gnu.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.63 > But yes, it breaks one of my favorite uses. > > The docstring previously said: > > "If WINDOW is non-nil, it specifies a window; we delete that window, > and the buffer that is killed or buried is the one in that window." > > Now, it says: > > "If WINDOW > is dedicated or a minibuffer window, delete it and, if it's the > only window on its frame, delete its frame as well provided there > are other frames left. Otherwise, display some other buffer in > the window." > > I was using the previously documented behavior. I have a function > > (defun quit-buffer-and-window () > (interactive) > (quit-window nil (selected-window))) > > (I assign it to "q" in many modes). Now, > > C-x 2 C-x o M-x quit-buffer-and-window > > leaves me with two windows. Sorry. I apparently fail to understand what that function is supposed to do. Please try the version below and tell me whether it does what you want. If it still doesn't, then please try to write a doc-string so I can implement what that doc-string says. Thank you, martin. (defun quit-window (&optional kill window) "Delete WINDOW and bury its buffer. WINDOW defaults to the selected window. Optional argument KILL non-nil means kill WINDOW's buffer instead of burying it. Always delete WINDOW if its frame contains at least one other window. If WINDOW is dedicated or a minibuffer window, and is the only window on its frame, try to delete its frame too. In any other case, display another buffer in WINDOW." (interactive "P") (let* ((window (or window (selected-window))) (buffer (window-buffer window))) (if (eq window (frame-root-window (window-frame window))) ;; WINDOW is the only window on its frame. `delete-windows-on' ;; knows how to handle that particular case. (delete-windows-on buffer (selected-frame)) ;; There are other windows left, delete just this window. But ;; don't throw an error if that fails for some reason; rather ;; switch to another buffer instead. (condition-case nil (delete-window window) (error (with-selected-window window (switch-to-buffer nil))))) ;; Deal with the buffer. (if kill (kill-buffer buffer) (bury-buffer buffer)))) From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: "Juanma Barranquero" , 1259@debbugs.gnu.org Resent-From: "Juanma Barranquero" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 14 Nov 2008 09:25:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122665437130132 (code B ref 1259); Fri, 14 Nov 2008 09:25:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.3 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 14 Nov 2008 09:19:31 +0000 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAE9JR7O030126 for <1259@emacsbugs.donarmstrong.com>; Fri, 14 Nov 2008 01:19:29 -0800 Received: by nf-out-0910.google.com with SMTP id 30so652245nfu.31 for <1259@emacsbugs.donarmstrong.com>; Fri, 14 Nov 2008 01:19:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=a+2Hee9bSNRrlItFgqIJcmpqGbtBFQU7jFl9jQWv7r4=; b=PqSAho0XFNR6XeHmT612svxXPCznmIZ6gSvtJlvSm8TrdsCmM3vNNdzM/t4jM5Yak6 Qs2WH8EEltpteOnx8K/QBLuOlvvop0uRekv6GUXlOYD0gT+/ow0VmSeBKbkk1Xwzccuw fXskQVVm97D4BpNE8IwgetJ8qMe4g/Lg/NMzE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=SNL7hbbGiEUe8IGeEeO5+K3E8Oq6AAcaOsfIuJ/1jRSGKlYiBaS4TXzkmxYJmtD+sw BgPhY8gTqi0OE01LqvdyXwM304hmb3hdgSLnU9vZIXr5zdGyc0JK3dyrK+RCVrVFz/Pj frOkPd05lS6brvy9RHg7FIP0Nbgqh4D5/z3tk= Received: by 10.210.123.2 with SMTP id v2mr842480ebc.0.1226654366595; Fri, 14 Nov 2008 01:19:26 -0800 (PST) Received: by 10.210.23.12 with HTTP; Fri, 14 Nov 2008 01:19:26 -0800 (PST) Message-ID: Date: Fri, 14 Nov 2008 10:19:26 +0100 From: "Juanma Barranquero" To: "martin rudalics" Cc: 1259@debbugs.gnu.org In-Reply-To: <491D318C.80402@gmx.at> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <491D318C.80402@gmx.at> On Fri, Nov 14, 2008 at 09:06, martin rudalics wrote: > Sorry. I apparently fail to understand what that function is supposed > to do. Truth be told, the docstring in 22.X wasn't very clear. The function is called quit-window, but it talked about burying/killing the buffer, and only off-handedly said: "If window is non-nil, it specifies a window; we delete that window, and the buffer that is killed or buried is the one in that window." (Incidentally, that's the reason I defined quit-buffer-and-window in the first place; with your changes, my function would be just an alias for quit-window). > Please try the version below and tell me whether it does what > you want. Yes, it works as expected now. Thanks, Juanma From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: "Juanma Barranquero" , 1259@debbugs.gnu.org Resent-From: "Juanma Barranquero" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 14 Nov 2008 09:45:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.12266553652375 (code B ref 1259); Fri, 14 Nov 2008 09:45:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.6 required=4.0 tests=AWL,BAYES_00,GMAIL, MURPHY_DRUGS_REL8 autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 14 Nov 2008 09:36:05 +0000 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAE9a1TE002369 for <1259@emacsbugs.donarmstrong.com>; Fri, 14 Nov 2008 01:36:03 -0800 Received: by ey-out-2122.google.com with SMTP id 4so591182eyf.13 for <1259@emacsbugs.donarmstrong.com>; Fri, 14 Nov 2008 01:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UWELt5CLnKpOk71/OHeGZY/Y/2pEnbrbQeZ2jr+FvpA=; b=B4DyBgQPlU13Zq8E813uz4KMygudjaOzQF320kxG7nLYjUlRL0v3EFqd95JXdllXMq 0/fPZLQMjBd03S318LSVUMckDO1FO4y/XbYmS3t0oH/NLsEDuB+JvghxRAYgRfg71XdM wxGKUbyFG+rKnn0KoCMfj8bImvu/F5eOlm2KI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=bDBlKKtw4u5EaGfQGnzqT8zSwFK2PdSFkL64LWtrT0+4jVy10G1UnDvl6jfBdCagd8 /0jnGI/2FoidOMasBduQTgGnTR1jxmKXS/osoIxNPFuwChR2YVd31SYdm4KqIYD6otyz ZHSfgn+3CRBB4xifiXYbNjD2xauNgevk58bwg= Received: by 10.210.67.4 with SMTP id p4mr849727eba.20.1226655360964; Fri, 14 Nov 2008 01:36:00 -0800 (PST) Received: by 10.210.23.12 with HTTP; Fri, 14 Nov 2008 01:36:00 -0800 (PST) Message-ID: Date: Fri, 14 Nov 2008 10:36:00 +0100 From: "Juanma Barranquero" To: "martin rudalics" Cc: 1259@debbugs.gnu.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <491D318C.80402@gmx.at> On Fri, Nov 14, 2008 at 10:19, Juanma Barranquero wrote: > Yes, it works as expected now. To add more information: the difference in behavior between your committed patch (let's call it v1) and the one you just sent (v2) is related to defaulting to the selected window. I mean, with the following defun (defun my-quit-window () (interactive) (quit-window nil (selected-window))) and testing with emacs -Q C-h N M-x occur emacs C-x o M-x quit-window ;; or M-x my-quit-window In 22.X: M-x quit-window => buries the buffer, keeps the window M-x my-quit-window => buries the buffer, kills the window In 23.X, v1 M-x quit-window => buries the buffer, keeps the window M-x my-quit-window => buries the buffer, keeps the window In 23.X, v2 M-x quit-window => buries the buffer, kills the window M-x my-quit-window => buries the buffer, kills the window So, basically the original `quit-window' had two different behaviors, while your patches just have one. Personally, I'm happy with the "kills the window" behavior, so v2 works for me. But perhaps other people expects quit-window to behave as it did in 22.X. Juanma From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: martin rudalics , 1259@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 14 Nov 2008 13:50:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122667021430987 (code B ref 1259); Fri, 14 Nov 2008 13:50:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.4 required=4.0 tests=AWL,BAYES_00,FOURLA autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 14 Nov 2008 13:43:34 +0000 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 mAEDhUMM030974 for <1259@emacsbugs.donarmstrong.com>; Fri, 14 Nov 2008 05:43:31 -0800 Received: (qmail invoked by alias); 14 Nov 2008 13:43:23 -0000 Received: from 88-117-34-6.adsl.highway.telekom.at (EHLO [88.117.34.6]) [88.117.34.6] by mail.gmx.net (mp026) with SMTP; 14 Nov 2008 14:43:23 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19JV3AN1lJJPxXvyzDaNZpYsbof21xWfrW5rcja7O EmSM1jLJHUb8qQ Message-ID: <491D7FF3.4050507@gmx.at> Date: Fri, 14 Nov 2008 14:41:07 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Juanma Barranquero CC: 1259@debbugs.gnu.org References: <491D318C.80402@gmx.at> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6 > In 22.X: > > M-x quit-window => buries the buffer, keeps the window [...] > In 23.X, v1 > > M-x quit-window => buries the buffer, keeps the window [...] Thanks for investigating this. I was to silly to figure it out. Deleting the window iff it's explicitly specified strikes me as non-intuitive. Anyway, the version below should do that. Please give it another try. And thanks again for the explanations, martin. (defun quit-window (&optional kill window) "Quit WINDOW and bury or kill its buffer. WINDOW defaults to the selected window. If WINDOW is dedicated or a minibuffer window, delete WINDOW and, if it's alone on its frame, its frame too. Else, if WINDOW was explicitly specified and not nil, delete it. Otherwise, or if deleting WINDOW fails in any of the preceding cases, display another buffer in WINDOW using `switch-to-buffer'. Optional argument KILL non-nil means kill WINDOW's buffer. Otherwise, bury WINDOW's buffer, see `bury-buffer'." (interactive "P") ;; Don't let-bind WINDOW here; below we want to know whether the ;; WINDOW argument was explictly specified. (let* ((window-to-handle (or window (selected-window))) (buffer (window-buffer window-to-handle))) (cond ((or (window-minibuffer-p window-to-handle) (window-dedicated-p window-to-handle)) ;; Minibuffer windows and dedicated windows are treated specially. (let ((frame (window-frame window-to-handle))) (if (eq window-to-handle (frame-root-window frame)) ;; The window to handle is alone on its frame. ;; `delete-windows-on' knows what to do. (delete-windows-on buffer frame) ;; There are other windows on the frame, delete this one. (delete-window window-to-handle)))) ((not window) ;; No WINDOW was specified. Switch to another buffer in the ;; selected window. (switch-to-buffer nil)) (t ;; WINDOW was specified, try to delete it. But don't throw an ;; error if that fails; rather switch to another buffer instead. (condition-case nil (delete-window window-to-handle) (error (with-selected-window window-to-handle (switch-to-buffer nil)))))) ;; Deal with the buffer. (if kill (kill-buffer buffer) (bury-buffer buffer)))) From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: "Juanma Barranquero" , 1259@debbugs.gnu.org Resent-From: "Juanma Barranquero" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 14 Nov 2008 15:20:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122667543021666 (code B ref 1259); Fri, 14 Nov 2008 15:20:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.5 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 14 Nov 2008 15:10:30 +0000 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAEFAQx1021660 for <1259@emacsbugs.donarmstrong.com>; Fri, 14 Nov 2008 07:10:28 -0800 Received: by yw-out-2324.google.com with SMTP id 3so647830ywj.31 for <1259@emacsbugs.donarmstrong.com>; Fri, 14 Nov 2008 07:10:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=LDKjyrY9hNNQyKumwaYIIn6h6O+WZ5Vcjlgg67TJHGc=; b=o08K/p714GeBskOFwCrhBhsGEzgrZeYsUBXgyK2e6PKzfSjkIGYlSeFyTqxO1Lp3uk llEemKP5KDc24ZPAidB9+lq0plT5do1ThHWYVL2FJb9K4yRsivSnBJbNTyomyclrow5W eoYGZzZzADSZxrHfi8tY2JlGFMyxD7u/DofI4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=grb8qvAjGBGC306KZyhNlx3ATz1Vb6ifDPhGhGgySfdvryFghlDhUXQp3WoomxYzEf UjEQ7fHu1s3tAbPJeIIIaPyCl3K7nr3v8uyGTnXrwv+2ai6pRvwtybcowmEdO3mjFte6 QMMEoWeBhsIRu4+FJb1IdLLCWPJYGAfBCUR8M= Received: by 10.100.197.7 with SMTP id u7mr524414anf.72.1226675426575; Fri, 14 Nov 2008 07:10:26 -0800 (PST) Received: by 10.100.13.13 with HTTP; Fri, 14 Nov 2008 07:10:26 -0800 (PST) Message-ID: Date: Fri, 14 Nov 2008 16:10:26 +0100 From: "Juanma Barranquero" To: "martin rudalics" Cc: 1259@debbugs.gnu.org In-Reply-To: <491D7FF3.4050507@gmx.at> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <491D318C.80402@gmx.at> <491D7FF3.4050507@gmx.at> On Fri, Nov 14, 2008 at 14:41, martin rudalics wrote: > Deleting the window iff it's explicitly specified strikes me as > non-intuitive. I think quit-window conflates two interfaces, one for humans that does not kill the window, and another for elisp that allows killing it; that second interface does not need to be "interactively intuitive", but certainly is not illogical (the programmer is taking the pain to explicitly pass a window instead of using the default, after all). I just happened to be using interactively the second interface. > Anyway, the version below should do that. > > Please give it another try. It works as expected now for quit-window and my-quit-window. I've only tested my common use of the function, though: single frame, one window (plus the one killed by quit-window). Thanks for fixing this, Juanma From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: Markus Triska , 1259@debbugs.gnu.org Resent-From: Markus Triska Original-Sender: Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 14 Nov 2008 17:10:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122668222416383 (code B ref -1); Fri, 14 Nov 2008 17:10:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-9.8 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 14 Nov 2008 17:03:44 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAEH3e3E016377 for ; Fri, 14 Nov 2008 09:03:42 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L1255-0008DE-NN for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2008 12:03:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L1252-0008AM-9L for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2008 12:03:38 -0500 Received: from [199.232.76.173] (port=56747 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L1252-0008AD-4c for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2008 12:03:36 -0500 Received: from moderators.individual.net ([130.133.4.7]:45667) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L1252-0004nt-DE for bug-gnu-emacs@gnu.org; Fri, 14 Nov 2008 12:03:36 -0500 Received: from novembaer.univie.ac.at ([193.171.255.22]) by moderators.individual.net (Exim 4.69) for gnu-emacs-bug@moderators.isc.org with esmtp (envelope-from ) id <1L1250-0004er-G2>; Fri, 14 Nov 2008 18:03:34 +0100 Received: from news by novembaer.univie.ac.at with local (Exim 4.20) id 1L124z-0004O0-7y for gnu-emacs-bug@moderators.isc.org; Fri, 14 Nov 2008 18:03:33 +0100 To: gnu-emacs-bug@moderators.isc.org From: Markus Triska Newsgroups: gnu.emacs.bug References: <491D318C.80402@gmx.at> Date: Fri, 14 Nov 2008 18:03:06 +0100 Message-ID: Cancel-Lock: sha1:HN5nvfjmdDqMdU3CwMOqELhNNO0= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 14 NNTP-Posting-Host: news-access-from.tuwien.ac.at X-Trace: 1226682213 tunews.univie.ac.at 10578 192.35.241.118 X-Complaints-To: abuse@tuwien.ac.at Sender: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) martin rudalics writes: > Optional argument KILL non-nil means kill WINDOW's buffer. > Otherwise, bury WINDOW's buffer, see `bury-buffer'." Could you please mention the meaning of a prefix argument in interactive use again? Previously, the docstring included the now missing sentence: With a prefix argument, kill the buffer instead. C-u q is a great feature in many modes (doc-view-mode, image-mode etc.), because it does not ask for which buffer to kill (in contrast to C-x k), so I hope it remains available and documented. Thank you in advance! From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: martin rudalics , 1259@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 15 Nov 2008 10:10:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122674331212482 (code B ref 1259); Sat, 15 Nov 2008 10:10:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 15 Nov 2008 10:01:52 +0000 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 mAFA1mSp012474 for <1259@emacsbugs.donarmstrong.com>; Sat, 15 Nov 2008 02:01:50 -0800 Received: (qmail invoked by alias); 15 Nov 2008 10:01:43 -0000 Received: from 88-117-39-71.adsl.highway.telekom.at (EHLO [88.117.39.71]) [88.117.39.71] by mail.gmx.net (mp031) with SMTP; 15 Nov 2008 11:01:43 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18ip5tp0gYif4S1FwYnyqjsAAsSSFcSwE3gQvb7XN twBppD9fC2+2xQ Message-ID: <491E9DAA.4030202@gmx.at> Date: Sat, 15 Nov 2008 11:00:10 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Juanma Barranquero CC: 1259@debbugs.gnu.org References: <491D318C.80402@gmx.at> <491D7FF3.4050507@gmx.at> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.84 > It works as expected now for quit-window and my-quit-window. I checked in a simpler version. Could you try once more? martin From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: martin rudalics , 1259@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 15 Nov 2008 10:10:07 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.122674331712489 (code B ref 1259); Sat, 15 Nov 2008 10:10:07 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 15 Nov 2008 10:01:57 +0000 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 mAFA1sm2012476 for <1259@emacsbugs.donarmstrong.com>; Sat, 15 Nov 2008 02:01:55 -0800 Received: (qmail invoked by alias); 15 Nov 2008 10:01:48 -0000 Received: from 88-117-39-71.adsl.highway.telekom.at (EHLO [88.117.39.71]) [88.117.39.71] by mail.gmx.net (mp066) with SMTP; 15 Nov 2008 11:01:48 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+WWZB3W7aWAQJx63FQo/nyuTlN+6Uxev85SiQKKW KUJ+UMdqqRAgKi Message-ID: <491E9DAF.7060101@gmx.at> Date: Sat, 15 Nov 2008 11:00:15 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Markus Triska CC: 1259@debbugs.gnu.org References: <491D318C.80402@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.85 > Could you please mention the meaning of a prefix argument in interactive > use again? Previously, the docstring included the now missing sentence: > > With a prefix argument, kill the buffer instead. It's there again. martin From unknown Sun Sep 21 06:36:28 2025 X-Loop: don@donarmstrong.com Subject: bug#1259: quit-window does not kill the window Reply-To: "Juanma Barranquero" , 1259@debbugs.gnu.org Resent-From: "Juanma Barranquero" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 15 Nov 2008 11:30:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1259 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1259-submit@emacsbugs.donarmstrong.com id=B1259.1226748164902 (code B ref 1259); Sat, 15 Nov 2008 11:30:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.5 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1259) by emacsbugs.donarmstrong.com; 15 Nov 2008 11:22:44 +0000 Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAFBMfVs000895 for <1259@emacsbugs.donarmstrong.com>; Sat, 15 Nov 2008 03:22:42 -0800 Received: by yx-out-2324.google.com with SMTP id 8so791139yxg.31 for <1259@emacsbugs.donarmstrong.com>; Sat, 15 Nov 2008 03:22:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=JZQ0uElsEDuCKFOhluMS3k4sS4EUMshRVl7DW8t4+ns=; b=fafg2uORXD265iYQr88eBVNHUw2nDPi53QtvNc0rZS3iXaP9EoFVA0DI7EKpctKgKj llYPYkrlSGeOkpljgiXYLKjdAfKIlNjlKWJKK2fy5icM5kEnZIJFTwJ01P02i2hEY5ig zGZyIJYQXsEQX86uogXPV+I6ompG9NYx4MecA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=U+xir4VibzQGbcxKsfOD2Em7wBiSzyVJKiFpTCKEZ1SBC+xs/VGpa88R/aryCSh0Lz uGdpHxlgjpkrgusyTSJvb7jXaOa6IBuj9MNJluVJvRX/Lp8mO5pAXqheJ0XaRET2KOIZ TzZQ/byTZAOjPcrviXrrLzXWXmcfRSV43l+4A= Received: by 10.100.141.10 with SMTP id o10mr919992and.41.1226748161091; Sat, 15 Nov 2008 03:22:41 -0800 (PST) Received: by 10.100.13.13 with HTTP; Sat, 15 Nov 2008 03:22:41 -0800 (PST) Message-ID: Date: Sat, 15 Nov 2008 12:22:41 +0100 From: "Juanma Barranquero" To: "martin rudalics" Cc: 1259@debbugs.gnu.org In-Reply-To: <491E9DAA.4030202@gmx.at> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <491D318C.80402@gmx.at> <491D7FF3.4050507@gmx.at> <491E9DAA.4030202@gmx.at> On Sat, Nov 15, 2008 at 11:00, martin rudalics wrote: > I checked in a simpler version. Could you try once more? Yes, it works as expected. Thanks, Juanma