emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] agenda: Consider FILETAGS for archive skipping


From: Dauer, Michael
Subject: Re: [PATCH] agenda: Consider FILETAGS for archive skipping
Date: Sun, 17 May 2020 10:54:49 +0200

Hi,

I support George view. A working ARCHIVE tag on file level would be consistent and very useful.

To be archived is a property of the content of a file, not of it's file name. Having to store the file name on a variable is a complicated and poor workaround. The file name may change. Still the content should stay archived. 

Regards,
Michael

Kyle Meyer <address@hidden> schrieb am So., 17. Mai 2020, 07:34:
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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]