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: George Sokolsky
Subject: Re: [PATCH] agenda: Consider FILETAGS for archive skipping
Date: Mon, 18 May 2020 11:34:19 +0200

Thank you very much Kyle for the patch you provided!

I had to apply it manually on the latest org-20200518 (line numbers
changed in this new version or me too lame) - the patch seem to fix the
below problem and works just fine!

IMHO using "#+FILETAGS: ARCHIVE" is one of legitimate ways of applying
ARCHIVE tag to items in org. As such I'd love the below patch included
into the official org distribution. I'm trying to add Bastien into
recepients of this e-mail - or could anyone please help with commiting
the below code into the org repository?

Thank you,
George

Kyle Meyer <address@hidden> writes:

> 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))



reply via email to

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