From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#59862: quit-restore per window buffer Date: Sun, 13 Oct 2024 09:18:00 +0300 Organization: LINKOV.NET Message-ID: <86a5f8cyqv.fsf@mail.linkov.net> References: <86fsds8mlm.fsf@mail.linkov.net> <86le2b12ni.fsf@mail.linkov.net> <86y169kafb.fsf@mail.linkov.net> <61c4f245-3dd8-4e24-9c84-7ddd4cfe3c49@gmx.at> <86a5ioo269.fsf@mail.linkov.net> <867cdr3xs7.fsf@mail.linkov.net> <3f399d4f-3dd2-4624-b857-e198f70b5565@gmx.at> <86h6csct0w.fsf@mail.linkov.net> <38aedd8d-8966-44eb-afc0-79b4db412483@gmx.at> <86r0b9tqo3.fsf@mail.linkov.net> <22c18c89-b288-4c2e-83ae-11fd7cb1ec24@gmx.at> <86ed78w7t4.fsf@mail.linkov.net> <86msjefqfa.fsf@mail.linkov.net> <6272a373-1e7c-4df9-b0c2-e535ca3fe49b@gmx.at> <864j5ll110.fsf@mail.linkov.net> <9c103d92-c8f5-4fe7-934f-2f56219475b8@gmx.at> <86msjbyfqx.fsf@mail.linkov.net> <4ccff054-18bf-4149-8100-37fd26ea2992@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36717"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: 59862@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 13 08:23:58 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1szs1G-0009QE-1T for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Oct 2024 08:23:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1szs18-0001v7-5b; Sun, 13 Oct 2024 02:23:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szs16-0001uq-Et for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 02:23:48 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1szs15-0008Hh-Ul for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 02:23:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=iOUGZbQh/6339TjTpvWYv/yj7/FynwdeEatXqsxkTeA=; b=FLgusr+byw3Lz6rrFPHhHHzS7sIUZxAj1WtlaFn40V+dolQjVjWEzZycwFojRh5wHHumKtmGb6AcQTsYZ8rkFMiy7/tCq9XrWkqlA0Dm4IXmdCJcm42HpxJFdoz1mLPZiBi8AXYM3Uq3OVmj2oZAk56Prv7Y6iTI7MaXOYr/GScZu2MIy8yGxUCMW2uQYxJEgV1AGSx/SL24t2P5IeEvEPfO1aNmxV22ep1D0e5kWFnxtsMHJX2VBDiKIWrVDbW8McQtn5q3OYUGOEZH9kvZ5aduCsv6py1fUBWLnuigGil6KPxmIPDiUxPlDZIpdbrkIQr/RQlGwUuPC0K1Xf+Sww==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1szs1J-0004Ky-O8 for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 02:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Oct 2024 06:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59862 X-GNU-PR-Package: emacs Original-Received: via spool by 59862-submit@debbugs.gnu.org id=B59862.172880059616605 (code B ref 59862); Sun, 13 Oct 2024 06:24:01 +0000 Original-Received: (at 59862) by debbugs.gnu.org; 13 Oct 2024 06:23:16 +0000 Original-Received: from localhost ([127.0.0.1]:49981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szs0a-0004Jl-03 for submit@debbugs.gnu.org; Sun, 13 Oct 2024 02:23:16 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:45987) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szs0X-0004JR-HA for 59862@debbugs.gnu.org; Sun, 13 Oct 2024 02:23:14 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 4EA1060003; Sun, 13 Oct 2024 06:22:29 +0000 (UTC) In-Reply-To: <4ccff054-18bf-4149-8100-37fd26ea2992@gmx.at> (martin rudalics's message of "Fri, 11 Oct 2024 09:50:44 +0200") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293497 Archived-At: >> + ((and tab-bar-mode > > Wouldn't > > (> (frame-parameter frame 'tab-bar-lines) 0) > > be more accurate? > >> + (> (length (funcall tab-bar-tabs-function frame)) 1) >> + ;; Close the tab with the initial window (bug#59862) >> + (or (eq (nth 1 (window-parameter window 'quit-restore)) 'tab) >> + ;; or with the dedicated window (bug#71386) > > Please always close comments with a period. > >> + (window-dedicated-p window)) >> + ;; Don't close the tab if more windows were created explicitly >> + (< (seq-count (lambda (w) (window-parameter w 'quit-restore)) >> + (window-list-1 nil 'nomini)) > > Shouldn't you give 'window-list-1' a FRAME argument? Thanks, will fix these. Also noticed this needs 'car': (memq (car (window-parameter w 'quit-restore)) '(window tab frame)) Also during testing for a few days I found a problem that prevents fixing bug#71386: 1. C-x t 2 2. C-x d any_dir 3. mark files with 'm' 4. R other_dir This unexpectedly closes the tab. This is because (window-dedicated-p window) in window-deletable-p in the patch discovers that the window with the buffer " *Marked files*" is dedicated while trying to delete this window. So probably to fix bug#71386 need to add another condition that closes the tab only when there are no more windows on the frame: (and (window-dedicated-p window) (frame-root-window-p window))