From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kA7+IdfMwF4eEgAA0tVLHw (envelope-from ) for ; Sun, 17 May 2020 05:34:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SMnkHdfMwF6yKAAA1q6Kng (envelope-from ) for ; Sun, 17 May 2020 05:34:15 +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 7802C940275 for ; Sun, 17 May 2020 05:34:14 +0000 (UTC) Received: from localhost ([::1]:37934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaBwD-0004Jo-2R for larch@yhetil.org; Sun, 17 May 2020 01:34:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaBvp-0004JQ-7v for emacs-orgmode@gnu.org; Sun, 17 May 2020 01:33:49 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:64585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaBvn-0007YK-GY for emacs-orgmode@gnu.org; Sun, 17 May 2020 01:33:48 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id CA827536F9; Sun, 17 May 2020 01:33:25 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=km/Nzc02csQzfR7vPuMr3uB/HkY=; b=Nni7RA dacRwcN//J1YnUtxxGzVkTwnlWHddqGie+3zgHtAzUkZjquhm+uMWb1mKBcY/v0h 9NTCcTmZXAj+Hx3Dt/yk7EqO2kjVotzq8HVEYH32ehXQznUAHj1boDQBUq415knn JKC1cZdO8d1/l4QtM/TajHscrEjYpJ522JTa0= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id C2B7E536F8; Sun, 17 May 2020 01:33:25 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=IQK0YZT59bO+sDoEzBBLiia7WYTjYPNW6LfDWbAkGbc=; b=hAJluK8TzwYHWVML+sXOOlEd8SVz7AT2x3zz0/5fobzj5J6tEyX6vKcKb8IWzbtg7E7BOJ5rGDSEJ9VHCe29t+M6rHO+BPqCNAMAK7KhETInlL0pLoAHjWMSGgK6q3mNElF+3Ykc8IsTmvVzBwRkH8F1x2LWMybax5OapunmIKM= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 3F80F536F7; Sun, 17 May 2020 01:33:25 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: George Sokolsky , emacs-orgmode@gnu.org Subject: [PATCH] agenda: Consider FILETAGS for archive skipping In-Reply-To: <87pnb4i217.fsf@posteo.net> References: <87pnb4i217.fsf@posteo.net> Date: Sun, 17 May 2020 05:33:24 +0000 Message-ID: <87blmnt9az.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: EDF2B19E-97FF-11EA-ADAE-D1361DBA3BAF-24757444!pb-smtp2.pobox.com Received-SPF: pass client-ip=64.147.108.71; envelope-from=kyle@kyleam.com; helo=pb-smtp2.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 00:04:17 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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=pobox.com header.s=sasl header.b=Nni7RA d; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=hAJluK8T; 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: -1.21 X-TUID: /WfaS5VjYhGw 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