From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12.migadu.com with LMTPS id +PpsBKJLhGQIPAEATFOONw (envelope-from ) for ; Sat, 10 Jun 2023 12:08:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EG2DBKJLhGQffAEA9RJhRA (envelope-from ) for ; Sat, 10 Jun 2023 12:08:34 +0200 Received: from mail1.fsfe.org (mail1.fsfe.org [IPv6:2001:aa8:ffed:f5f3::151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C36602B69C for ; Sat, 10 Jun 2023 12:08:33 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b=MzYDZFiN; dmarc=pass (policy=none) header.from=fsfe.org; spf=pass (aspmx1.migadu.com: domain of jlicht@fsfe.org designates 2001:aa8:ffed:f5f3::151 as permitted sender) smtp.mailfrom=jlicht@fsfe.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1686391713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IhCsjf8b43ckoAoXz2AWG4Z5Cccfyj28PlgkJJJvUUw=; b=AOLmFGokIETtKIOkOAnck4XUwVSB8czaPgYfIKqieofGHmSAtLo2lW+VnREl6vtEwPt7Za 1fiTJ9LXgLNDZOBFXnP2PrI0W3RGVw9QobpzNsj9uSDJbm366NAADO4Y3DVoAwd6PLKLLo pvFOfa6IvOxA1LWNkGvJhCUImJaHfRpOGHtAgOUSPZ+LISSdwK+y/9vOa9PZ2sFL8BtjuN o9Xr4tDtwZLWyRev3Gko9Yns+jLkqVrl+Xp1QZWfbUv9FPeBX5UJIMx+JrpaAMnvuykKVR T7gh1y8GG1EUGzga3cu/cWRSed1i0ULi7OzZfnOPuhfwUZ8cHz7YHqPLBMOXtQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fsfe.org header.s=2021100501 header.b=MzYDZFiN; dmarc=pass (policy=none) header.from=fsfe.org; spf=pass (aspmx1.migadu.com: domain of jlicht@fsfe.org designates 2001:aa8:ffed:f5f3::151 as permitted sender) smtp.mailfrom=jlicht@fsfe.org ARC-Seal: i=1; s=key1; d=kyleam.com; t=1686391713; a=rsa-sha256; cv=none; b=G0OvwC77/k8OLS8uXL6gzcQLWJQrSYyFiJhY9jZnIE/gU9ZG5JTZ8DAaJKURaCH+m6EaOC raZrEWqcD9xYhxefYnisfN2BMrv7ROpU4xlc4RQDdGpkQtPizs3Kde0Z6oIvpZ5lwgoZe8 VySFjUDWJGSt6QJCa5seUNHm879gyUjiu9LiDqOuZbreNxKLNOyuNNqy8IzymnKlr33tgd TAmiJ1oiD91j+is7fWD6sEBUAQzLjj0VXuNfZn8DjTTXLygAXlx73aFJkg3+D/jRbP1EF8 mLm2JGJgFTiItXXxofdKiEMtZQ2vi/W7SROib8rvEerXkL78IebMCu/OkXtXJQ== From: Jelle Licht DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fsfe.org; s=2021100501; t=1686391706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IhCsjf8b43ckoAoXz2AWG4Z5Cccfyj28PlgkJJJvUUw=; b=MzYDZFiNTGrob9g5Ggv5ZVJ0846PjMIfa0lW0hHViLv5NA6IT1cUIOHaZ+JQLP1N22+ZOS MAexeLGGkbcxmf1GX1NDYLu+JndtUazOGzXXl/r6Mhl7XnHFeqzm1Nj5VFeEP0w3H6ivjE tnV0ilwYjKSLbVykDwiNLQ6jiOHeu9Y= To: Kyle Meyer Cc: piem@inbox.kyleam.com Subject: Re: [PATCH v2 3/5] piem: Add piem-inbox-by-gnu-package-match. In-Reply-To: <87sfazncc8.fsf@kyleam.com> References: <87sfazncc8.fsf@kyleam.com> Date: Sat, 10 Jun 2023 12:08:25 +0200 Message-ID: <87h6rfmxye.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Country: UNKNOWN X-Migadu-Flow: FLOW_IN X-Spam-Score: -3.01 X-Migadu-Queue-Id: C36602B69C X-Migadu-Scanner: in3.migadu.com X-Migadu-Spam-Score: -3.01 X-TUID: 49+hjBghUwLt Kyle Meyer writes: > jlicht@fsfe.org writes: > >> diff --git a/piem.el b/piem.el >> index 914dd23..3fffb0e 100644 >> --- a/piem.el >> +++ b/piem.el >> @@ -490,6 +490,21 @@ non-nil, make the match specific for that message." >> (mail-decode-encoded-word-string val))) >> headers)))) >> >> +(defun piem-inbox-by-gnu-package-match (gnu-package) >> + "Return inbox based on matching :gnu-package properties. >> +GNU-PACKAGE should be a string. This function is intended to be > > Convention: two spaces after period Done in V3. Any setting or .dir-locals I can use to not consistently keep forgetting to do this? >> +used by libraries implementing a function for >> +`piem-get-inbox-function'." >> + (when gnu-package >> + (catch 'hit >> + (dolist (inbox (piem-merged-inboxes)) >> + (let* ((info (cdr inbox)) >> + (p-package (plist-get info :gnu-package))) >> + (when (and gnu-package >> + p-package >> + (string-match-p p-package gnu-package)) >> + (throw 'hit (car inbox)))))))) >> + > > I think it's nice to have this as a separate function, and I'm guessing > its use in the upcoming piem-debbugs.el is one of the reasons you > decided to do that. > > But perhaps piem-inbox-by-gnu-package-match should still be called in > piem-inbox-by-header-match, following the dolist there. The main > advantage of that is that debbugs.el also has Rmail support, so it'd let > piem-rmail-get-inbox take advantage of this header too. Plus, if > piem-notmuch users want to match against X-GNU-PR-PACKAGE for whatever > reason, even though they should have a List-ID too, it seems like we > might as well consistently support it. Done in V3.