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 0BjDIYeuyF5MRwAA0tVLHw (envelope-from ) for ; Sat, 23 May 2020 05:03:03 +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 sJa5HYeuyF6tTwAA1q6Kng (envelope-from ) for ; Sat, 23 May 2020 05:03:03 +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 96EB59404D4 for ; Sat, 23 May 2020 05:03:02 +0000 (UTC) Received: from localhost ([::1]:55610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcMJI-0001Ex-CI for larch@yhetil.org; Sat, 23 May 2020 01:03:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jcMIx-0001Ef-RZ for emacs-orgmode@gnu.org; Sat, 23 May 2020 01:02:39 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:57043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jcMIv-0006H7-KH for emacs-orgmode@gnu.org; Sat, 23 May 2020 01:02:39 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 95F5561BCB; Sat, 23 May 2020 01:02:35 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=aqz3ZhAxPUxujI4pLVldaisJA2k=; b=Z9+EdY UYcj3iiFQw3oW+IdN4DJEGJ8cP9RASMSviJVE4xIlQfBSjBUIvyHxjoVgcsuSSfL Uu2Rx+ucaVL8kB+zzyY8OB5gshx+RKYktpc+FtTWsUUYirq+8zkEI99RXZLYI68e R+3sFd4dzImdGOVv/5jMgWNuIAqo2lsZMyDzc= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 8BEE061BCA; Sat, 23 May 2020 01:02:35 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=zgjjgzzvoMXLAZQa8iSNw50URUA9g93KvG2O+R8lvRg=; b=F3lhzx05Qu4sJ5+STPQ+D781zmHh2eqdfAIptRJ8IxYJnwFBV3g+jzZcaFlZCnwu/kEISVB6EmVUdZotQleshUp2REdnMRJIrqeAkPp8CSLhft7FVis5fCLW2BBdtxuHR6VHc1zRfR43tiaOgZbr0mZb1pLsYr3aWt78Q9YE7ZE= 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 0E83E61BC9; Sat, 23 May 2020 01:02:35 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: Stefan Kangas Subject: Re: [PATCH] New function org-agenda-filter-set In-Reply-To: References: Date: Sat, 23 May 2020 05:02:34 +0000 Message-ID: <875zcns0ph.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 9D9F09D8-9CB2-11EA-8F3A-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/23 01:02:35 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: , Cc: 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=pass header.d=pobox.com header.s=sasl header.b=Z9+EdY U; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=F3lhzx05; 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: wH6fC7ynMXN0 Stefan Kangas writes: > Please find attached a patch to add a new function org-agenda-filter-set > which allows you to specify the same strings as in the org-agenda-filter > prompt directly from Lisp. It allows you to do things like: > > (org-agenda-filter-set "-@foo-bar") > > Before, this would have involved doing more of the heavy lifting > manually using org-agenda-filter-apply. Sounds good to me. > Subject: [PATCH] New function org-agenda-filter-set > > * lisp/org-agenda.el (org-agenda-filter) > (org-agenda-filter-set): Refactor out from 'org-agenda-filter', to > create a better interface to filter the agenda from Lisp. > --- > lisp/org-agenda.el | 100 +++++++++++++++++++++++++-------------------- > 1 file changed, 55 insertions(+), 45 deletions(-) As expected from the description, the bulk of this is code movement, all of which looked sensible when I inspected it with --color-moved=default --color-moved-ws=allow-indentation-change > -(defun org-agenda-filter (&optional strip-or-accumulate) > +(defun org-agenda-filter-set (str &optional force-keep negate) > + "Set agenda filter from string. > +The string is parsed according to the rules described in > +the `org-agenda-filter' command. > + > +If FORCE-KEEP is non-nil, add the new filter elements to the > +existing ones." nitpick: Could you update the docstring to explicitly mention STR and to describe NEGATE? Thanks for the patch.