From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.devel Subject: Re: tab-bar-mode new tab hook? Date: Mon, 25 Apr 2022 23:27:01 -0400 Message-ID: References: <86czh5jjj4.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27955"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 26 05:27:52 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 1njBrj-00073a-NN for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Apr 2022 05:27:51 +0200 Original-Received: from localhost ([::1]:58844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njBri-0005bm-Ig for ged-emacs-devel@m.gmane-mx.org; Mon, 25 Apr 2022 23:27:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njBrA-0004wc-Gb for emacs-devel@gnu.org; Mon, 25 Apr 2022 23:27:16 -0400 Original-Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:35606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njBr8-0004tK-Pv for emacs-devel@gnu.org; Mon, 25 Apr 2022 23:27:16 -0400 Original-Received: by mail-pl1-x62f.google.com with SMTP id d15so14567921plh.2 for ; Mon, 25 Apr 2022 20:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5qfdIsvKJNxNiZZUnMJgEyPwkNQFS92B71sOmXKhhKM=; b=H7H0u6zqaxalUkEry3SWG6eP2HRHe3E5LxEUhIUSVSwG31pbNnLOSSQXisapxuVsCW XlrhmHPHDWH+rO+zCLw2v8Ga2Ncf1P01RmgGdhDHTcszrB/44zpONdVHNuhA6Mq96tY1 gwmJJXj3/IeuluIt2AmlBqp+ZP91+R7Dnd3aunTyIaC/Oj8pffrM2Dl1Xk4OYUBtyQaJ yd4S7o7ShdaNcxira0GnX2I6iO2YFiyyVxGkb0+ejyCFLB80MD3D9T2PfV15uETlgvzF 1Kle7FRedI9BqsbOOvlnRdSf8KEYajwun7qfXpu/BUtx3n4+wlUgCEXXVqRyZJb8odWG lJhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5qfdIsvKJNxNiZZUnMJgEyPwkNQFS92B71sOmXKhhKM=; b=JbJg1+Jwa4m1d42xSXzEyW1lq4mViBXKShcF6/oZVxOcLmcWzaZvtZr0UjdmVBmXc9 AgZlC3xmXXNw2gtqFxkGoZ9i/jXeVcvTALH6pAk2oahuReW2GDp/xe48ABYwjh8JFPtv N4xQe3J3F6v/ORF5mNAuwYdwiTrDMhfDpDV+8RivO3W1fEkrtUlownU3Il/rGn78tz27 udKScISHmdXW7aFJ8Wv3NFmPi4pIl59ANulBUqtGnmyBrSJ9zkGVm8E8tU9TbNqbYY7D HTREECUuLqjPNR6qdFfPJiwIek4gjkEQ97szmr4nsmL9TD57NoMbKVG7LaN5pla1bX43 eOeQ== X-Gm-Message-State: AOAM533XyRkTfMBTJnfVXaVGUS/xUQFBfHaagvJ+Rci8irmOEkf0xea7 D0yXvc6We9M89a9oPfhTNNZZroaYmALkTyHez4g= X-Google-Smtp-Source: ABdhPJxDvrpJXUFsZ43KFz7g1wJ5qyHRXoAgeOCRHUqiopxtHrI6Zac7UKHKN2k+/phAy0ILWslGiCwHiEqlIymKf1w= X-Received: by 2002:a17:902:b698:b0:158:faee:442f with SMTP id c24-20020a170902b69800b00158faee442fmr21730265pls.75.1650943632809; Mon, 25 Apr 2022 20:27:12 -0700 (PDT) In-Reply-To: <86czh5jjj4.fsf@mail.linkov.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=aaronjensen@gmail.com; helo=mail-pl1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:288881 Archived-At: On Mon, Apr 25, 2022 at 11:45 AM Juri Linkov wrote: > > > I've been experimenting using tabspaces > > (https://github.com/mclear-tools/tabspaces) to enable each tab to have > > its own isolated buffer list. It provides a command, > > tabspaces-create-workspace that invokes tab-bar-new-tab and then sets > > frame parameters to isolate the buffer list space. > > > > I was curious if there has been any thought given to including a hook > > for when a new tab is created. This way, I could just add a hook to do > > this and not have to use a separate command (and replace all the other > > commands that use tab-bar-new-tab). I could use advice, but that seems > > like a last resort. > > 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 function would apply to the previous tab, rather than the about to be created tab. > > 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. Thanks, Aaron