From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iBuLNR/iRl8abwAA0tVLHw (envelope-from ) for ; Wed, 26 Aug 2020 22:28:47 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aMVQMR/iRl8PXQAAbx9fmQ (envelope-from ) for ; Wed, 26 Aug 2020 22:28:47 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CF3A1940365 for ; Wed, 26 Aug 2020 22:28:46 +0000 (UTC) Received: from localhost ([::1]:33722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB3uO-00050L-AQ for larch@yhetil.org; Wed, 26 Aug 2020 18:28:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB3u1-00050A-Ta for emacs-orgmode@gnu.org; Wed, 26 Aug 2020 18:28:22 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:58425) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB3tz-0002Jv-BC for emacs-orgmode@gnu.org; Wed, 26 Aug 2020 18:28:21 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id DBAF5EEBDE for ; Wed, 26 Aug 2020 18:28:16 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=me3OQBlqokUivJYqlDTpesWVs7M=; b=Ol3Kvb 09qlA664iR5sUJFl76LRvpQuifyIqyNv4LU5HzpSvT4l/Dxcw6OfRFtaQRJ7zPk2 wcTHzzyQjeEwjK8q5QbUyuWmKZnAt3B8+sNaYF1HnHaQ9zPuJGIiV+7b4z7EZxfx NoAdWR2lg78sfylgK9YVET6uSHFDoNlA4dPJw= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id D450CEEBDD for ; Wed, 26 Aug 2020 18:28:16 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=61iGCAKgojG8XSFxZ9GuSKZzDyr3E+1uaog4e+0NHN0=; b=z9t7C6MxZ2QyOh6ctVJs8e+bcB7luC2vWk0OM3E8nqpqNAQ+dUjLdpWXwJ8EO0r/rlK4NCbTfbu/RiaEqjd9d6CV8B1p3ozju70JhNND92/Wmk/TvtEMr2w6bzqFA+bWKftSmM4Uj+l++Bm2UGOxnzZlIAG5OLQy6Vp762iD670= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 4B2F8EEBDB for ; Wed, 26 Aug 2020 18:28:14 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: emacs-orgmode@gnu.org Subject: Re: new feature for consideration: other-tab for org-agenda-window-setup In-Reply-To: <87eentqsws.fsf@ucl.ac.uk> References: <87eentqsws.fsf@ucl.ac.uk> Date: Wed, 26 Aug 2020 18:28:12 -0400 Message-ID: <87k0xlm48z.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 6E5EF186-E7EB-11EA-A8B9-843F439F7C89-24757444!pb-smtp21.pobox.com Received-SPF: pass client-ip=173.228.157.53; envelope-from=kyle@kyleam.com; helo=pb-smtp21.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/26 18:28:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=Ol3Kvb 0; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=z9t7C6Mx; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: OwOQT8VFhLN0 Eric S Fraga writes: > Hi, > > for those of us using more recent versions of Emacs, the new > tab-bar-mode can be quite useful. As I have been playing with, I > thought it would make sense to have the option for agenda views to > pop-up in a new tab as an option. I've coded something that behaves in > a similar way to the 'other-frame option that currently exists for > org-agenda-window-setup. > > Patch attached. Comments welcome, of course. Thanks. Sounds fine to me. > Subject: [PATCH] added other-tab option for org-agenda-window-setup > > * org-agenda.el (org-agenda-prepare-window, org-agenda--quit): handle > other-tab option for agenda view creation and exit. Style conventions: s/added/Add/s/handle/Handle/ > --- > lisp/org-agenda.el | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index 8ebc882fc..abb969fe4 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -1100,11 +1100,15 @@ reorganize-frame Show only two windows on the current frame, the current > window and the agenda. > other-frame Use `switch-to-buffer-other-frame' to display agenda. > Also, when exiting the agenda, kill that frame. > +other-tab Use `switch-to-buffer-other-tab' to display the agenda. > + Also, kill that tab when exiting the agenda view. > + I think it's worth noting here which Emacs version gained tab support. > See also the variable `org-agenda-restore-windows-after-quit'." > :group 'org-agenda-windows > :type '(choice > (const current-window) > (const other-frame) > + (const other-tab) > (const other-window) > (const only-window) > (const reorganize-frame))) > @@ -1118,11 +1122,11 @@ It only matters if `org-agenda-window-setup' is `reorganize-frame'." > [...] > @@ -3769,6 +3773,8 @@ FILTER-ALIST is an alist of filters we need to apply when > (org-switch-to-buffer-other-window abuf)) > ((eq org-agenda-window-setup 'other-frame) > (switch-to-buffer-other-frame abuf)) > + ((eq org-agenda-window-setup 'other-tab) > + (switch-to-buffer-other-tab abuf)) > ((eq org-agenda-window-setup 'only-window) > (delete-other-windows) > (pop-to-buffer-same-window abuf)) > @@ -7389,6 +7395,8 @@ agenda." > (cond > ((eq org-agenda-window-setup 'other-frame) > (delete-frame)) > + ((eq org-agenda-window-setup 'other-tab) > + (tab-bar-close-tab)) > ((and org-agenda-restore-windows-after-quit > wconf) As you suggest in your follow-up message, you need to guard these calls for the sake of older versions. Perhaps something like (if (fboundp 'FN) (FN ...) (user-error "Your Emacs version doesn't support tabs")) in both spots. (That will silence the byte-compiler warnings too.)