emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* new feature for consideration: other-tab for org-agenda-window-setup
@ 2020-08-26 16:21 Eric S Fraga
  2020-08-26 16:28 ` Eric S Fraga
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Eric S Fraga @ 2020-08-26 16:21 UTC (permalink / raw)
  To: Emacs Org mode mailing list

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

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.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-719-gcdfc40.dirty

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-added-other-tab-option-for-org-agenda-window-setup.patch --]
[-- Type: text/x-diff, Size: 2891 bytes --]

From e715a495f9659a5cef39e25822e18651ecefcf32 Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
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


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-09-04  7:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 16:21 new feature for consideration: other-tab for org-agenda-window-setup Eric S Fraga
2020-08-26 16:28 ` Eric S Fraga
2020-08-26 22:28 ` Kyle Meyer
2020-08-27  9:50   ` Eric S Fraga
2020-08-27 10:51     ` Kyle Meyer
2020-08-27 19:31       ` Eric S Fraga
2020-08-28  4:27         ` Kyle Meyer
2020-08-29 12:07           ` Kyle Meyer
2020-08-31 13:09             ` Eric S Fraga
2020-09-03 10:16             ` Bastien
2020-09-03 12:29 ` Bastien
2020-09-03 21:26   ` Eric S Fraga
2020-09-04  7:06     ` Bastien
2020-09-04  7:50       ` Eric S Fraga
2020-09-03 21:28   ` Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).