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.devel Subject: Re: tab-bar-mode new tab hook? Date: Tue, 26 Apr 2022 10:27:19 +0300 Organization: LINKOV.NET Message-ID: <86o80oz4mg.fsf@mail.linkov.net> References: <86czh5jjj4.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17486"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Emacs developers To: Aaron Jensen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 26 09:31:58 2022 Return-path: Envelope-to: ged-emacs-devel@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 1njFfy-0004Nr-9z for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Apr 2022 09:31:58 +0200 Original-Received: from localhost ([::1]:40818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njFfx-0005Xs-38 for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Apr 2022 03:31:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njFdw-0004Xu-K9 for emacs-devel@gnu.org; Tue, 26 Apr 2022 03:29:53 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:42199) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njFdu-0003IU-Os for emacs-devel@gnu.org; Tue, 26 Apr 2022 03:29:52 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 05CEF1C000A; Tue, 26 Apr 2022 07:29:46 +0000 (UTC) In-Reply-To: (Aaron Jensen's message of "Mon, 25 Apr 2022 23:27:01 -0400") Received-SPF: pass client-ip=217.70.183.197; envelope-from=juri@linkov.net; helo=relay5-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288883 Archived-At: >> You can provide own custom function for tab-bar-new-tab-choice. >> Then you can set an initial buffer list in it, and even to display >> this buffer list as the default contents of the new tab. > > This function seems like it is meant to just return the buffer to > display in the new tab. It also seem like it is called before the new > tab is actually created. I haven't tried it yet, but I would think > that would mean that any modification of frame parameters in that tab-bar-new-tab-choice prepares the window configuration for the new tab, so it's a suitable place to modify frame parameters, e.g. (setq tab-bar-new-tab-choice (lambda () (set-frame-parameter nil 'name "tab-2") (current-buffer))) > function would apply to the previous tab, rather than the about to be > created tab. This detail is relevant only when you want to modify tab parameters. And tab parameters already include frame buffer-list and buried-buffer-list. So not only after creating a new tab, but also after switching between tabs these frame parameters get updated. >> > Alternatively (or in addition) is the behavior to isolate buffer lists >> > in tabs one that would make sense for Emacs to support out-of-the-box? >> >> There is already project-based buffer isolation that works nicely >> with tabs, so in a new tab you can set a tab group name, and just >> use project buffer commands: 'C-x p b' (project-switch-to-buffer), >> 'C-x p k' (project-kill-buffers), etc. Switching to a project buffer >> in a new tab is also supported with 'C-x t p b'. > > Yes, I used that before, but I like to be able to bring buffers in > from other projects and have them in my buffer list. Sort of reference > files from one project to another, so it is nice for them to actually > have their own buffer lists entirely that is not limited to those in > the project. Don't you think that a feature of limiting a list of buffers has only distant connection to tabs? Isn't it the purpose of project.el to define a list of buffers? So maybe it would be easier to add a new backend to project.el with a list of predefined files/buffers? There are also other packages that do something like this such as lisp/filesets.el and lisp/filecache.el. But if you want to plug such a feature into tabs, we could add more hooks to tab-bar-mode to make it easier to do this. So please help to identify these points for more customization.