George Sokolsky writes:
> I have .org files with "#+FILETAGS: ARCHIVE" headers.
>
> I want items from these .org files to be hidden by default from results
> of "org-agenda" -> "s Search for keywords" by default.
>
> This is not the case, unfortunately.
[...]
I'd guess that it's uncommon to try to set the ARCHIVE tag at the file
level, as file-level archiving is already dealt through
org-archive-location and friends. These standard files can optionally
be included with vA (or C-u M-x org-agenda-archives-mode).
> *How the above could be done, please?*
I don't see a built-in way to do it, though I think the patch below may
be sufficient to provide the behavior you want. It doesn't consider any
of the tag inheritance variables, but that's probably okay given that
those aren't considered for handling :ARCHIVE: subtrees either.
-- >8 --
Subject: [PATCH] agenda: Consider FILETAGS for archive skipping
* lisp/org-agenda.el (org-agenda-skip): Consider skipping all entries
in a file if org-archive-tag is set via FILETAGS.
---
lisp/org-agenda.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 9c73d0d6c..8ed5e402d 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4082,8 +4082,10 @@ (defun org-agenda-skip ()
(when (or
(save-excursion (goto-char p) (looking-at comment-start-skip))
(and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
- (get-text-property p :org-archived)
- (org-end-of-subtree t))
+ (or (and (get-text-property p :org-archived)
+ (org-end-of-subtree t))
+ (and (member org-archive-tag org-file-tags)
+ (goto-char (point-max)))))
(and org-agenda-skip-comment-trees
(get-text-property p :org-comment)
(org-end-of-subtree t))
--
2.26.2