From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pillule Newsgroups: gmane.emacs.bugs Subject: bug#48493: 28.0.50; quit-window doesn't work Date: Tue, 25 May 2021 13:01:05 +0000 Message-ID: <877djn3r3i.fsf@host.localdomain> References: <87h7j0wwkf.fsf@gmail.com> <87cztg41zy.fsf@host.localdomain> <878s434ls1.fsf@host.localdomain> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35439"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pillule , Sujith Manoharan , 48493@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 25 15:02:24 2021 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 1llWhT-0008xq-PJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 May 2021 15:02:24 +0200 Original-Received: from localhost ([::1]:56016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llWhS-0003wK-RN for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 May 2021 09:02:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llWh8-0003tD-M2 for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 09:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llWh8-00040L-Eu for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 09:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1llWh8-0005mY-Ce for bug-gnu-emacs@gnu.org; Tue, 25 May 2021 09:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: pillule Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 May 2021 13:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48493 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 48493-submit@debbugs.gnu.org id=B48493.162194769022179 (code B ref 48493); Tue, 25 May 2021 13:02:02 +0000 Original-Received: (at 48493) by debbugs.gnu.org; 25 May 2021 13:01:30 +0000 Original-Received: from localhost ([127.0.0.1]:44944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llWgZ-0005lc-97 for submit@debbugs.gnu.org; Tue, 25 May 2021 09:01:28 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:53838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llWgQ-0005lI-Tc for 48493@debbugs.gnu.org; Tue, 25 May 2021 09:01:19 -0400 Original-Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4FqDjP241JzDsDs; Tue, 25 May 2021 06:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1621947673; bh=Fvv3e2yGialX+JYlorPqK3rZO3UQSV2CoH4ynFwe01M=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=HeiwBVr+Kp4NJBTGTTyG5b5yDppTXtTjNMPLXjOGigIYhNyAl3aWc5Jxx+gEiPpZQ 6KrbSpecx5rdC1KJFJkFd/Zt1AyNOx7OKEZrzzXbYXo1rpvky8C02qKzCgoFWCXjmy eTn4316G+59C+J8V0U3VrpbsB8bj9zPutoVEtKeo= X-Riseup-User-ID: 06144BC4119548D9F97A5D581487C9F7D1694B9A26D311623AFBE08A16F1A8DF Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4FqDjM28Z1z1y6h; Tue, 25 May 2021 06:01:10 -0700 (PDT) In-reply-to: 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" Xref: news.gmane.io gmane.emacs.bugs:207203 Archived-At: martin rudalics writes: >> Then I suppose that the dedicated window parameter must be >> restored >> after a kill-buffer accordingly; this solve the previous test >> but >> ask for more modifications. > > Who makes any of these buffers dedicared? All windows created by `display-buffer-in-side-window' have the state (dedicated . side) Tiers libraries such as the module popup from Doom emacs come at this subject with the rule : --quitting/killing a buffer in a side window, always delete its window-- (it is done with a local value of kill-buffer-hook installed from their own `display-buffer-alist') instead of the rule : --quitting/killing a buffer in any window, 1 switch to its previous buffer 2 delete the window if no available 3 switch to another buffer if the window is not deletable-- Which is what I think you are asking and IMHO ask to deal with the dedicated window state to not cripple side-windows. >> I can modify to `switch-to-prev-buffer' (and its sibling >> `switch-to-prev-buffer') to return nil instead of the current >> buffer; >> however the result is the same : the window rest in place with >> an >> undesired buffer inside. >> Note that we may want that anyway if it can solve the cases >> where >> `quit-restore-window' display the same buffer again. >> >> I am still looking to find what may be messing the prev-buffers >> list. > > Try to experiment with an idiom like > > (if prev-buffer > ;; If a previous buffer exists, try to switch to it. > If that > ;; fails for whatever reason, try to delete the > window. > (unless (switch-to-prev-buffer window bury-or-kill) > (window--delete window nil (eq bury-or-kill 'kill))) > ;; If no previous buffer exists, try to delete the > window. If > ;; that fails for whatever reason, try to switch to some > other > ;; buffer. > (unless (window--delete window nil (eq bury-or-kill > 'kill)) > (switch-to-prev-buffer window bury-or-kill))) Thanks for the snippet, I think I am confused by this window dedication, please help me to clarify my mind before I try to implement a solution with or without the dedicated window state. --