From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#38354: 27.0.50; Implement display action display-buffer-in-tab Date: Thu, 05 Dec 2019 00:51:43 +0200 Organization: LINKOV.NET Message-ID: <87k17bn1q8.fsf@mail.linkov.net> References: <87imna2nsi.fsf@mail.linkov.net> <8736ea5kcz.fsf@mail.linkov.net> <7979be54-2a01-2e97-d956-2500e7999e26@gmx.at> <87d0dd3yb7.fsf@mail.linkov.net> <87r21r389g.fsf@mail.linkov.net> <87lfrvk7cg.fsf@mail.linkov.net> <6be9eb15-062d-b15f-04c8-993a2a2eee22@gmx.at> <87h82i9tvd.fsf@mail.linkov.net> <87pnh5m16o.fsf@mail.linkov.net> <6fbb734e-2fce-c148-0387-8cbe9bba649c@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="253251"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 38354@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 05 00:28:46 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ice4a-0013jE-V8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Dec 2019 00:28:45 +0100 Original-Received: from localhost ([::1]:48068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ice4Z-00036o-NW for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2019 18:28:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55371) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ice3y-0002Oo-4w for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 18:28:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ice3v-00043X-WA for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 18:28:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ice3u-00040C-GE for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 18:28:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ice3u-000218-Cj for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 18:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Dec 2019 23:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38354 X-GNU-PR-Package: emacs Original-Received: via spool by 38354-submit@debbugs.gnu.org id=B38354.15755020517703 (code B ref 38354); Wed, 04 Dec 2019 23:28:02 +0000 Original-Received: (at 38354) by debbugs.gnu.org; 4 Dec 2019 23:27:31 +0000 Original-Received: from localhost ([127.0.0.1]:42789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ice3P-00020B-9c for submit@debbugs.gnu.org; Wed, 04 Dec 2019 18:27:31 -0500 Original-Received: from caracal.birch.relay.mailchannels.net ([23.83.209.30]:11720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ice3N-000202-72 for 38354@debbugs.gnu.org; Wed, 04 Dec 2019 18:27:29 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 02B32580AF9; Wed, 4 Dec 2019 23:27:28 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a19.g.dreamhost.com (100-96-87-246.trex.outbound.svc.cluster.local [100.96.87.246]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 978F5580B69; Wed, 4 Dec 2019 23:27:27 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a19.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Wed, 04 Dec 2019 23:27:27 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Lyrical-Illegal: 4acd630174dd04b9_1575502047840_3551732829 X-MC-Loop-Signature: 1575502047840:2773614917 X-MC-Ingress-Time: 1575502047840 Original-Received: from pdx1-sub0-mail-a19.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a19.g.dreamhost.com (Postfix) with ESMTP id 3D73CB76F3; Wed, 4 Dec 2019 15:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=XvQSgmRQH8/PY7HHnIYdhNXNUtQ=; b= QKm9iMV9e3g2cTG/2cFO3Mj8sPatAc4SrkcS+lR64bIMkvgxTmMJwlq2GiTWhjAd cCPVV+45tnS5X/iNqktOBv+CEa9KoPckcbsfAwJsEts0RMdGkIhhO0M5tSxXqfbt A5Est/hQ9n9Mo4v3u0S4HePuzXnYjqxI8VOlk3tzr+o= Original-Received: from mail.jurta.org (m91-129-96-42.cust.tele2.ee [91.129.96.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a19.g.dreamhost.com (Postfix) with ESMTPSA id AE45AB76F4; Wed, 4 Dec 2019 15:27:24 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a19 In-Reply-To: <6fbb734e-2fce-c148-0387-8cbe9bba649c@gmx.at> (martin rudalics's message of "Wed, 4 Dec 2019 10:22:39 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172862 Archived-At: >>> In either case, do I read the code correctly that it can prefer a >>> window in a non-current tab to a window in a current tab on another >>> frame. If so, do we want that? >> >> Do you think it should return a list of all tabs owning a window >> with the buffer? > > No. I meant that it should continue to scan frames as long as it has > not found a window showing that buffer. During that scan it would > record the first tab that has a window whose buffer is the one searched > for. The return value would then be preferably (the tab of) a window > actually showing the buffer or, if no such window exists, a tab that > has a window whose buffer is the one searched for. > >> Why not? Does display-buffer-reuse-window currently prefers >> a window on the same frame even when a window on another frame >> also shows the same buffer? > > It does. But I don't say that 'display-buffer-in-tab' must do the > same. What I meant was, as sketched above, to prefer a tab where a > window already shows the buffer to tabs that would show the buffer but > only if they were current/active or tabs where such a buffer window > would have to be added first. I have no preference, but don't understand why the implementation should provide only one way, but not another. Is it what users expect? >> Additional question: using quit-window on the buffer displayed >> by display-buffer-in-tab should close its tab. Could you recommend >> how to implement this? Maybe to add an additional argument CLOSE-TAB >> to quit-restore-window? e.g. >> >> (defun quit-restore-window (&optional window bury-or-kill close-tab) >> ... >> >> For testing I tried to call '(tab-bar-close-tab)' at the end of >> 'quit-restore-window' unconditionally, but sometimes it does wrong thing: >> when quitting the last window of the frame closes the frame, >> '(tab-bar-close-tab)' closes the tab on another frame that >> is selected after closing the original frame. > > Then 'tab-bar-close-tab' is probably the wrong function to call here. > > But why do you want to close a tab (an entire window configuration) > here? Shouldn't 'quit-restore-window' just remove that window from a > tab, that is, update the current tab of that frame to what it is? Or > does the current tab of a frame not necessarily match that frame's > window configuration? It should close the tab only on quitting the window with the buffer whose displaying created the tab. For example, when 'switch-to-buffer-other-tab' creates a new tab, then quitting its buffer should close the tab. This is the same logic as for creating/deleting the window, e.g. 'C-h f car RET' creates a window, but typing 'q' in Help buffer deletes the window. 'q' in a new tab should close it as well.