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: Fri, 29 Nov 2019 01:02:43 +0200 Organization: LINKOV.NET Message-ID: <87r21r389g.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="187733"; 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 Fri Nov 29 00:47:08 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 1iaTV5-000mh8-Mp for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Nov 2019 00:47:07 +0100 Original-Received: from localhost ([::1]:54030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaTV2-0000mV-Ay for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Nov 2019 18:47:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43271) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaTSE-0007k4-F9 for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2019 18:44:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaTS7-0008Sk-MY for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2019 18:44:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53288) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iaTS7-0008S7-IR for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2019 18:44:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iaTS7-0005ZJ-GY for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2019 18:44:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Nov 2019 23:44:03 +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.157498463721363 (code B ref 38354); Thu, 28 Nov 2019 23:44:03 +0000 Original-Received: (at 38354) by debbugs.gnu.org; 28 Nov 2019 23:43:57 +0000 Original-Received: from localhost ([127.0.0.1]:59258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iaTS1-0005YP-3B for submit@debbugs.gnu.org; Thu, 28 Nov 2019 18:43:57 -0500 Original-Received: from bonobo.elm.relay.mailchannels.net ([23.83.212.22]:55504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iaTRy-0005YE-EH for 38354@debbugs.gnu.org; Thu, 28 Nov 2019 18:43:55 -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 6C6FCE0F66; Thu, 28 Nov 2019 23:43:52 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a33.g.dreamhost.com (100-96-88-70.trex.outbound.svc.cluster.local [100.96.88.70]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E846EE0E29; Thu, 28 Nov 2019 23:43:51 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a33.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); Thu, 28 Nov 2019 23:43:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Callous-Whimsical: 4a31af7c61c1be7a_1574984632270_3149504540 X-MC-Loop-Signature: 1574984632270:2099951649 X-MC-Ingress-Time: 1574984632270 Original-Received: from pdx1-sub0-mail-a33.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a33.g.dreamhost.com (Postfix) with ESMTP id 218397FC5F; Thu, 28 Nov 2019 15:43:46 -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=Axcm5t8IhR11l/t0solzqnASlss=; b= soAh7oTvyTMTW78dP5MGq5KufGB/04fL1rlIfwj5WHZjP/O3/1RZpNsCbgjX+arf ARi5qT4gkMLui39FtU55fAA6udfArm2x3hGrIRoiFcsBhs8WuV1KW4Hy0JINHwqe oxG7VUgth2pNiI9Nlt/t7AmMmnhhqmp60gH5M9fIeL0= 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-a33.g.dreamhost.com (Postfix) with ESMTPSA id 4301B7FC51; Thu, 28 Nov 2019 15:43:42 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a33 In-Reply-To: (martin rudalics's message of "Thu, 28 Nov 2019 10:20:59 +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:172630 Archived-At: >> (tab-bar-buffer-visible-in-tabs-p buffer) > > But this may also return non-nil when the buffer is invisible, that is > not shown in any window. We already have the "visible frames" > notation, including the non-obscured frames connotation, so I'd rather > not use the term visible in the context of tabs. Maybe like having the terms "visible frame" and "iconified frame", we should use the terms "current tab" and "inactive tabs". > Wouldn't something like 'tab-bar-buffer-present-in-tabs-p' or > 'tab-bar-buffer-in-tabs-p' be more intuitive? Instead of suffix '-p' that assumes the function returns a boolean value, better to return the found tab with the function name 'tab-bar-buffer-in-tab'. >>> - to say that a buffer is actually displayed on a frame that has a >>> tab-bar. >> >> In my code I use for this: >> >> (>= (length (get-buffer-window-list buffer t t)) 1) > > Why not simply 'get-buffer-window'? Because actually I used more complicated logic: (> (length (get-buffer-window-list buffer t t)) 1) that means don't kill the current buffer if it's also displayed somewhere else. > In either case what does the above "displayed" in > >>>> to display the buffer in an existing tab if such buffer is >>>> already displayed in it. > > refer to now? The former, the latter or their > >> i.e. I check these situations differently, and use 'or' >> to combine these conditions: >> >> (or (>= (length (get-buffer-window-list buffer t t)) 1) >> (tab-bar-buffer-visible-in-tabs-p buffer)) >> >> Should these conditions be combined in one function >> (if the current tab can be considered a tab as well)? > > 'or'? Anyway it seems better not to use the word "displayed". >>> And why "tabs" indiscriminately? Don't you ever want to check for >>> presence or visibility in a specific tab only? >> >> A specific tab referred by name? Maybe such function could be useful as well. > > Don't you ever want to discriminate the tabs of the selected frame > from the tabs of other frames? Or are they all the same? This means we need to add another dimension: first to look for the buffer in all tabs of the selected frame, then look in tabs of other frames: visible, iconified, or on any frame. >>> 'display-buffer-reuse-window' together with 'reusable-frames' should >>> have all the ingredients for this. What is missing? >> >> Than we need to add 'reusable-tabs'? > > Why? If a target tab (a tab with the name specified by ALIST) exists > on any frame specified by 'reusable-frames', reuse it. Otherwise make > a new frame with the target tab as its only entry. I don't understand. Should ALIST look like this? (push '("test1" . ((display-buffer-reuse-window display-buffer-in-tab) (reusable-frames . visible) (name . "Tab1"))) display-buffer-alist)