From e715a495f9659a5cef39e25822e18651ecefcf32 Mon Sep 17 00:00:00 2001 From: Eric S Fraga Date: Wed, 26 Aug 2020 17:17:42 +0100 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. --- 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. + 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'." (defcustom org-agenda-restore-windows-after-quit nil "Non-nil means restore window configuration upon exiting agenda. -Before the window configuration is changed for displaying the agenda, -the current status is recorded. When the agenda is exited with -`q' or `x' and this option is set, the old state is restored. If -`org-agenda-window-setup' is `other-frame', the value of this -option will be ignored." +Before the window configuration is changed for displaying the +agenda, the current status is recorded. When the agenda is +exited with `q' or `x' and this option is set, the old state is +restored. If `org-agenda-window-setup' is `other-frame' or +`other-tab', the value of this option will be ignored." :group 'org-agenda-windows :type 'boolean) @@ -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) ;; Maybe restore the pre-agenda window configuration. Reset -- 2.28.0