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 UBGsC81Wwl58YwAA0tVLHw (envelope-from ) for ; Mon, 18 May 2020 09:35:09 +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 6ENyB81Wwl6QFgAAbx9fmQ (envelope-from ) for ; Mon, 18 May 2020 09:35:09 +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 CBC699400EF for ; Mon, 18 May 2020 09:35:07 +0000 (UTC) Received: from localhost ([::1]:41152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jacAr-0002rn-5z for larch@yhetil.org; Mon, 18 May 2020 05:35:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jacAF-0002qV-2U for emacs-orgmode@gnu.org; Mon, 18 May 2020 05:34:27 -0400 Received: from mout02.posteo.de ([185.67.36.66]:33329) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jacAD-0004op-8u for emacs-orgmode@gnu.org; Mon, 18 May 2020 05:34:26 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 078D9240100 for ; Mon, 18 May 2020 11:34:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1589794461; bh=+ZgoR8ba1zE2DcPdoy5ArsdTRmSTvxKkzuVF6UJQo1A=; h=From:To:Cc:Subject:CC:Date:From; b=kZyGxndwYawP938t0EJJPxASbsPULhM+7FlEWdbhKFXyml5NUMbLIPUR67e9Rfgfo cw7c8gs6CfXcL5HmmRPcLTA3N2DSZQRXjbKO/CVfW+THqt2OIdNxHvC2xXzf8OmBBy IdUy/rt3SBLKJ0h9nGMthz0eu9iB+hv6jvoBj0aPyHJftinCUvMoGkr5xScDBeHF6W TEUbKQuNozLsDW18BhjEsW8kkpwfipH1e1jS+g1ltT3Ug4NjFEB1/wHN5xpk1HVooP yT9wc3z3ZtIylL88xUiGBex1X1Nv9gEKzpuU0PzU/O6/zyONApfxwGSGCEW/5D3l6S jWslYwjHNZLqg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 49QYkM4rjHz9rxX; Mon, 18 May 2020 11:34:19 +0200 (CEST) From: George Sokolsky To: Kyle Meyer , michael.dauer@smartpm.com, bzg@gnu.org Subject: Re: [PATCH] agenda: Consider FILETAGS for archive skipping In-Reply-To: <87blmnt9az.fsf@kyleam.com> (message from Kyle Meyer on Sun, 17 May 2020 05:33:24 +0000) Date: Mon, 18 May 2020 11:34:19 +0200 Message-ID: <87blmlmvs4.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=sokolgeo@posteo.net; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/18 05:34:21 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: sokolgeo@posteo.net, emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=posteo.net header.s=2017 header.b=kZyGxndw; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=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.09 X-TUID: a5zoYLCdu1fk 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 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))