emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: George Sokolsky <sokolgeo@posteo.net>, emacs-orgmode@gnu.org
Subject: [PATCH] agenda: Consider FILETAGS for archive skipping
Date: Sun, 17 May 2020 05:33:24 +0000	[thread overview]
Message-ID: <87blmnt9az.fsf@kyleam.com> (raw)
In-Reply-To: <87pnb4i217.fsf@posteo.net>

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	other threads:[~2020-05-17  5:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16 10:53 Org-agenda ignores archive tag set by "#+FILETAGS: ARCHIVE" George Sokolsky
2020-05-17  5:33 ` Kyle Meyer [this message]
2020-05-17  8:54   ` [PATCH] agenda: Consider FILETAGS for archive skipping Dauer, Michael
2020-05-18  9:34   ` George Sokolsky
2020-05-18  9:52     ` Bastien
2020-05-18 10:09       ` George Sokolsky
2020-05-18 11:48         ` Bastien
2020-05-18 12:17           ` George Sokolsky
2020-05-19  0:43             ` Kyle Meyer
2020-05-21  3:05             ` Kyle Meyer
2020-05-21  7:16               ` George Sokolsky
2020-05-24 10:57 ` Org-agenda ignores archive tag set by "#+FILETAGS: ARCHIVE" Bastien
2020-05-24 17:06   ` Kyle Meyer
2020-05-25  8:28     ` George Sokolsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blmnt9az.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sokolgeo@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).