From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CKh0DQ78wF7GWwAA0tVLHw (envelope-from ) for ; Sun, 17 May 2020 08:55:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id eIIuCQ78wF5jHgAAbx9fmQ (envelope-from ) for ; Sun, 17 May 2020 08:55:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8670A9404E1 for ; Sun, 17 May 2020 08:55:41 +0000 (UTC) Received: from localhost ([::1]:40594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaF58-0005Z7-LM for larch@yhetil.org; Sun, 17 May 2020 04:55:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaF4d-0005X3-UP for emacs-orgmode@gnu.org; Sun, 17 May 2020 04:55:07 -0400 Received: from mail-vs1-xe42.google.com ([2607:f8b0:4864:20::e42]:44034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaF4c-0004an-E2 for emacs-orgmode@gnu.org; Sun, 17 May 2020 04:55:07 -0400 Received: by mail-vs1-xe42.google.com with SMTP id w65so1130710vsw.11 for ; Sun, 17 May 2020 01:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartpm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=qZdYRL+sD/+l8X6ER4aG637i4A0nK77wdmNrJJYJCds=; b=TEMnLkAMkeAKvdloipY60A9MLlDXqI8Rjg9UARQQRAiHbCE3BMN4lvtSV/oSBtWJFD XRrLb7LmuH56tEkTuStSCazVAs5ubV1/IUy3DCtq4ycbUHAjWN2MArtXIH6iwgE5qKEO 3aSRJMoR3RAXWDpfWMTsc5+2sgX4VJURaPjDfuZtudi+zVl916Xupxp0jh5ZT2NgH4yY QcAGEIurGDgHoG7e0nTJrePfWlv1OzZa69jWLfE2kAqHOivcJdXeK5INytvZifWB2Zee OI9HSDDMBGheQ42o9Bva/ysLhl2ALGVEl+7XtfBz0mnvoUZJdO2I7j9s+oKVTv8SRdod NI+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=qZdYRL+sD/+l8X6ER4aG637i4A0nK77wdmNrJJYJCds=; b=hIyNRaH+upnAVlQuRvZPonPRg5sK26+A87zItiB7LSVE+GIlo46p6Vjfp9DOfpX1MP VZ+zH+qH3IqMT/VriSDL90pV3MgzV88iQ1tDlKVIFv+bMwy7Ln6exqMSrewgp8HHIgQ4 AiK5pD0w5EtPrSjyqs9DpaSh8twv5UeIyOoP2t7lNVL0EMpDiBWt2RM6i6HH0fL7HyBc qm6JhLolYfRMNii+0kMFX1E9PGIHAoDTwr3i16yOVoO2i//SuSw9hhCyq48t5Ym+v/Cm sgAFc0BwnbuNgTjg0lzrJGoJpZ6iCuNDz/JyVQddvtwuy6GuoSXgWYG3XhK/RH5IInUg s0HA== X-Gm-Message-State: AOAM530Gw/vnHcCgTgHEGhkt7DbRIiz6nq88slcx505vx84lbuy2DdF9 3maGKLtYYsmnLBq/qBA6zs1LCD9gVdzUJsB0uFQKFZCsBTA= X-Google-Smtp-Source: ABdhPJzlbvj9Y2C0aw3YTdlnUUYox4etnQ8WAY1CTu6h7+KVIuKiz/rXyAiabhF2vDGOZHDS9B0wkAd+n9aC+PS1gqo= X-Received: by 2002:a67:1dc5:: with SMTP id d188mr8019306vsd.103.1589705702577; Sun, 17 May 2020 01:55:02 -0700 (PDT) MIME-Version: 1.0 References: <87pnb4i217.fsf@posteo.net> <87blmnt9az.fsf@kyleam.com> In-Reply-To: <87blmnt9az.fsf@kyleam.com> From: "Dauer, Michael" Date: Sun, 17 May 2020 10:54:49 +0200 Message-ID: Subject: Re: [PATCH] agenda: Consider FILETAGS for archive skipping To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000b32a7d05a5d4330a" Received-SPF: pass client-ip=2607:f8b0:4864:20::e42; envelope-from=michael.dauer@smartpm.com; helo=mail-vs1-xe42.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=smartpm-com.20150623.gappssmtp.com header.s=20150623 header.b=TEMnLkAM; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.29 X-TUID: yrbjWM96fH+H --000000000000b32a7d05a5d4330a Content-Type: text/plain; charset="UTF-8" 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 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 > > > --000000000000b32a7d05a5d4330a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

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

To be archi= ved is a property of the content of a file, not of it's file name. Havi= ng to store the file name on a variable is a complicated and poor workaroun= d. The file name may change. Still the content should stay archived.=C2=A0<= /div>

Regards,
Michael

Kyle Meyer <ky= le@kyleam.com> schrieb am So., 17. Mai 2020, 07:34:
George Sokolsky writes:

> I have .org files with=C2=A0 "#+FILETAGS: ARCHIVE" headers.<= br> >
> I want items from these .org files to be hidden by default from result= s
> of "org-agenda" -> "s Search for keywords" by d= efault.
>
> This is not the case, unfortunately.
[...]

I'd guess that it's uncommon to try to set the ARCHIVE tag at the f= ile
level, as file-level archiving is already dealt through
org-archive-location and friends.=C2=A0 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.=C2=A0 It doesn't consid= er 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.
---
=C2=A0lisp/org-agenda.el | 6 ++++--
=C2=A01 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 ()
=C2=A0 =C2=A0 =C2=A0(when (or
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion (goto-char p) (loo= king-at comment-start-skip))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(and org-agenda-skip-archived-tree= s (not org-agenda-archives-mode)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(get-text-property = p :org-archived)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-end-of-subtree= t))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(or (and (get-text-= property p :org-archived)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (org-end-of-subtree t))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(and = (member org-archive-tag org-file-tags)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (goto-char (point-max)))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(and org-agenda-skip-comment-trees=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (get-text-property = p :org-comment)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-end-of-subtree= t))
--
2.26.2


--000000000000b32a7d05a5d4330a--