From 4798f9b7fadc078a914cd399e797084c166fd1b0 Mon Sep 17 00:00:00 2001 From: Andrew Hyatt Date: Sun, 28 Jan 2024 21:33:20 -0400 Subject: [PATCH] lisp/org-agenda.el Add org-agenda-start-with-archives-mode * lisp/org-agenda.el: Add org-agenda-start-with-archives-mode. (org-agenda-mode): Set value of org-agenda-archive-mode according to value of new variable org-agenda-start-with-archives-mode. * doc/org-manual.org: Note new variable in documentation of org-agenda-archives.mode. * etc/ORG-NEWS: Note change to add org-agenda-start-with-archives-mode. --- doc/org-manual.org | 6 +++++- etc/ORG-NEWS | 5 +++++ lisp/org-agenda.el | 11 ++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index ffb025c93..86008164e 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -10077,9 +10077,13 @@ the other commands, point needs to be in the desired line. #+kindex: v a #+findex: org-agenda-archives-mode + #+vindex: org-agenda-start-with-clockreport-mode Toggle Archives mode. In Archives mode, trees that are archived (see [[*Internal archiving]]) are also scanned when producing the - agenda. To exit archives mode, press {{{kbd(v a)}}} again. + agenda. To exit archives mode, press {{{kbd(v a)}}} again. The + initial setting for this mode in new agenda buffers can set with the + variable ~org-agenda-start-with-archives-mode~, which can be set + with the same values as ~org-agenda-archives-mode~. - {{{kbd(v A)}}} :: diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index f4e98d78b..82090df32 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -686,6 +686,11 @@ manner with ~run-python~. This allows to run functions after ~org-indent~ intializes a buffer to enrich its properties. +*** New option ~org-agenda-start-with-archives-mode~ + +This option starts the agenda to automatically include archives, +propagating the value for this variable to ~org-agenda-archives-mode~. +For acceptable values and their meaning, see the value of that variable. ** New features *** =ob-plantuml.el=: Support tikz file format output diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 20da364b5..7fe482f30 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -1102,6 +1102,14 @@ removed from entry text before it is shown in the agenda." :group 'org-agenda :type 'string) +(defcustom org-agenda-start-with-archives-mode nil + "Initial value of archive-mode in a newly created agenda window. +See `org-agenda-archives-mode' for acceptable values and their +meaning." + :group 'org-agenda-startup + :package-version '(Org . "9.7") + :type 'boolean) + (defvar org-agenda-entry-text-cleanup-hook nil "Hook that is run after basic cleanup of entry text to be shown in agenda. This cleanup is done in a temporary buffer, so the function may inspect and @@ -2372,7 +2380,8 @@ The following commands are available: (setq org-agenda-follow-mode org-agenda-start-with-follow-mode org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode org-agenda-show-log org-agenda-start-with-log-mode - org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode)) + org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode + org-agenda-archives-mode org-agenda-start-with-archives-mode)) (add-to-invisibility-spec '(org-filtered)) (org-fold-core-initialize `(,org-link--description-folding-spec ,org-link--link-folding-spec)) -- 2.39.3 (Apple Git-145)