From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cLiTJZxDMmTxXAEASxT56A (envelope-from ) for ; Sun, 09 Apr 2023 06:48:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yMCxJJxDMmS6WAEAG6o9tA (envelope-from ) for ; Sun, 09 Apr 2023 06:48:28 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4CE5F1AB51 for ; Sun, 9 Apr 2023 06:48:28 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 4A59B5F7EF; Sun, 9 Apr 2023 04:48:18 +0000 (UTC) Received: from smtp.bonedaddy.net (smtp.bonedaddy.net [45.33.94.42]) by mail.notmuchmail.org (Postfix) with ESMTPS id E9D355F36E for ; Sun, 9 Apr 2023 04:48:14 +0000 (UTC) Received: by smtp.bonedaddy.net (Postfix, from userid 10001) id 2C738305E33; Sun, 9 Apr 2023 00:40:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bonedaddy.net; s=mail; t=1681015228; bh=/zwknttHMuNmS5FFHIpuvzMakJsaaWsDNXuVlfUgBTA=; h=Subject:From:Reply-To:To:In-Reply-To:References:Date; b=N0ARdisDheUBDaA9WNE28vdY+z1RpVpAF6kbvSFE26d0mePNQYgSyrkbds5uX8+Nx YgiVfQMuQn2kG0nbFS+3PBmq3mZh18fZcau1ra3yU2Bh9vKxkKTnGc0FkSjpkhUJ9Q yLscGr1jsk53hjR7cHRhFJam7hawLWC9fiR7W/EvZfhCkWBWCQLZKns1M76fyuHnLE pO/JEVoIakbdzRa/gLsHFCjS+NyZo/nWE1JdkluVrcrZCkUlN2bhZCd0aEeOcmFFAU GCN+WmthmPJzWR8/jtaeYgUbeQGPjxgLkxh1nVpNWUbl7MhEd4vgP1U6HwCvUh4azT UjZRryLk4nvFw== Message-ID: <28f564aaeee5bfe4dfd007850920eecbb19daba0.camel@bonedaddy.net> Subject: Re: [PATCH] notmuch-mutt: replace extra command with notmuch-native thread search feature From: Paul Wise To: notmuch@notmuchmail.org In-Reply-To: <87355aob0e.fsf@minkowski.home> References: <20230407005452.2904978-1-pabs3@bonedaddy.net> <87355aob0e.fsf@minkowski.home> Date: Sun, 09 Apr 2023 12:38:53 +0800 MIME-Version: 1.0 User-Agent: Evolution 3.46.4-1 Message-ID-Hash: ADYBKRLFOQ6FE3SJODZRX5PP3AL6NW6F X-Message-ID-Hash: ADYBKRLFOQ6FE3SJODZRX5PP3AL6NW6F X-MailFrom: pabs3@bonedaddy.net X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Paul Wise , notmuch@notmuchmail.org List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============3752852337658877967==" X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681015708; a=rsa-sha256; cv=none; b=Mt/VwljYu4CQpUGasD6Z8eQc7Dk7J9Uq7zwhsA+5nAh8Zbq5kZbJJA1LjKinxu9MRxRrzp IG7/nB15qZVFWCdhoopIU94Z/wJtrXr1Xr4nKWalRA8HgpPoz5o67YbH9waUb+clFJi/o4 L6+4zkPGxpstYt/zwvJKeJJroOzvNKdI5ZKo9JyEgOKssaeIA35FOpOvB+MY4e/t4V12uD zlSy7Z7FYKrSjR0/zqh59gLMFfEeqZ39Gp+X3hH1Mfz1hDA/KmIzFpNf51mFp01OGwrcbi JTv0dc3I9HxjX3EtcB7w8587mHTFkiHps+L1nuZUm5cmOSyfhbaNTjWMLmgvqA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=bonedaddy.net header.s=mail header.b=N0ARdisD; dmarc=fail reason="SPF not aligned (relaxed)" header.from=bonedaddy.net (policy=quarantine); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681015708; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-owner:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9Fydd1WR7MaoVqJUoPL/IEsQ51VKmDl2XuGxL0yZPXE=; b=UjPTCrRYVH4PIGOR73+0FwMmjnckmCc6kQmuPunbhVWxDQXf94H0kJmsNrXPtnXbvbiyqc 2slDhcS02eFWpKxJ45XhxL4VkvVFClWC5Vzm+Y6yoccnRxMkncL/fQe5Pkf6ghgu15BeiA 2HY4cKulqZ/hGezM6rg1LIjVOP+pBKo/ajDRUaoCZVsi8fU5zgQVLSdtDe7GxPeNhbWW4s wSZ7dzo45Grp9xa63xKaS2S5f14fd1l2AsBSRWeWjUlLMiVlq5vjP9nO6Ct4vuIIwRo3HE yO191AhXafV8qOecR81XqAr6fSXvHHMQryxvnXz/IQ/b1hGZEpxpEn5s/maEqQ== X-Migadu-Spam-Score: 6.00 X-Spam-Score: 6.00 X-Migadu-Queue-Id: 4CE5F1AB51 X-Migadu-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=bonedaddy.net header.s=mail header.b=N0ARdisD; dmarc=fail reason="SPF not aligned (relaxed)" header.from=bonedaddy.net (policy=quarantine); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Scanner: scn1.migadu.com X-Spam: Yes X-TUID: iO/GlQyKBQ0p --===============3752852337658877967== Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-C3Tw1sc4fAqi7GzTDQre" --=-C3Tw1sc4fAqi7GzTDQre Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2023-04-08 at 08:42 -0300, David Bremner wrote: > did you test this with a message-id with spaces in it? > the quoting is a delicate. You are correct that the quoting for this was wrong, as it was also wrong in the code before my patch and I just copied that, however... I noticed that when notmuch stores the Message-ID in the Xapian database, it strips the spaces, so messages with spaces in the Message-ID are not found unless the id: search has no spaces also. After switching from testing using id: to subject: and reading the manual page I was able to find the correct quoting for spaces in $mid, but I also added the space removals for the thread query. Then I figured I should test with double quote characters and that blew up in my face too, so I added double quote doubling to workaround that. Then I noticed that you can put parentheses inside a quoted query and that changes the meaning of the query but I couldn't find any way to prevent an arbitrary Message-Id from inserting parentheses into the query. Also notmuch converts Message-Id (test)@hostname to just @hostname in the Xapian database. I think that right now I am not sure that re-implementing all the idiosyncrasies of notmuch queries and Message-Id munging within notmuch-mutt is the way to go, especially since Message-Id fields that intersect with notmuch features are rare. So I think that it would be good if there were a library for notmuch query construction that would take care of all the different quoting levels, Message-Id munging etc. This could then get language bindings so that notmuch based tools and MUAs could use them for interactive graphical query construction. Also maybe Xapian needs or has a way to construct queries without serialising them to a text string and the notmuch query construction library I propose could base itself on that. Anyway, will send an updated patch series including space/quote fixing. --=20 bye, pabs https://bonedaddy.net/pabs3/ --=-C3Tw1sc4fAqi7GzTDQre Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEYQsotVz8/kXqG1Y7MRa6Xp/6aaMFAmQyQVIACgkQMRa6Xp/6 aaOcKg//adBkQYwNr5ihO/e/TSOeB3zzsL5bBpPn698GXA8wibh82y+9Sn4yLfFx /Q01w+Oqj++7QiUjTiAXnYXhiiVVWTqQkpnYn/E4D32kcWQzkFDG3bpICfo9ITOx DjTWXS9HFSmVTv8ucqWKDcUiw8jt0eFC0EFdshnUNuMWr3bbli1zPBdMIGbT8lev 5Slbc+LdXM0p6lf/kbTHR+O5DnEca3+ZLSpZrC0g3gR22OJ0hRWkNQVZWBIIt+jI rS4h4md200tpWnVYkIGQktCvGIM6x1FcFsJkxsBiS6/ugquM84KozV7hE/o0ciSb WvTMZ2+y2vpAKG6HcTPWsqJ/Ou1DdIw4kTWDsjDBQ7vQ+xJL/eYsbyjWHJRGsvN6 +4D8f80bSLojx4yBGcvq1uBmNn0SvDYEwS48D+EMPM0J2BPD1mpSoayTksUe3yBk G1v+pn+yPsqgHiRkug+j2sx/YnTA4yU+sByXQlOJd0O7pYSctb/C7CN5WFel/5wi z5ODrOXZYjXGujZcsnbkrINa0eq4ABPWJsZo3nf4w07CLXdkLTZA7RuMue1VeMOJ YhYFSDFvA7diw/Fep/b6hgg6AOaULmXTaEI58LVcTsXMxAWQoUkf10lcgb80lqEb eLelGsIBc/Jcai9U+BiBqfkwkRW+BNAOv8yYRJRanWjAArgufBE= =P8j6 -----END PGP SIGNATURE----- --=-C3Tw1sc4fAqi7GzTDQre-- --===============3752852337658877967== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============3752852337658877967==--