`notmuch-escape-boolean-term': Broken for non-ascii characters
authorMoritz Ulrich <moritz@tarn-vedra.de>
Mon, 11 Aug 2014 20:38:16 +0000 (22:38 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:04:12 +0000 (10:04 -0800)
de/673912859b984c71e3dc32621d09f07f5fcf21 [new file with mode: 0644]

diff --git a/de/673912859b984c71e3dc32621d09f07f5fcf21 b/de/673912859b984c71e3dc32621d09f07f5fcf21
new file mode 100644 (file)
index 0000000..19286db
--- /dev/null
@@ -0,0 +1,124 @@
+Return-Path: <moritz@tarn-vedra.de>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 8212E431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 11 Aug 2014 13:38:53 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id hzXnYoG1yy3J for <notmuch@notmuchmail.org>;\r
+       Mon, 11 Aug 2014 13:38:48 -0700 (PDT)\r
+Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com\r
+       [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 46249431FB6\r
+       for <notmuch@notmuchmail.org>; Mon, 11 Aug 2014 13:38:42 -0700 (PDT)\r
+Received: by mail-wi0-f179.google.com with SMTP id f8so4817448wiw.12\r
+       for <notmuch@notmuchmail.org>; Mon, 11 Aug 2014 13:38:40 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:subject:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=ouhEPtOPMnADPP/+25P0gJ/ASzWG51ShCx4T2z/IXf0=;\r
+       b=OkaYXSvZJU/8Bp8dwj3/3IB8wVsZTzyofsfq820IZolF0oadkDPMoXEq9k8iriu6W/\r
+       HVm8M9EsMQ4rrQOlmNa87NwUa5/z+c1MGKRPuZd6gFD0eQlu5RFdXRZOmi6uzr5eoIro\r
+       YfXOZftHppES1GA1GQ7upCNv9UogPwNPCdxxU6ZN+d/10pu5ktuav6JFsrzyOt8jpjdg\r
+       3586yDaqkqzwad7PWObloPjFYvJgQWRqkSExytCfYGz1mqP78n7CzJc5Ecbu/UcM7kOo\r
+       ou/i/SNP7luLle0OGwOQn/W5GEdZFp4oSLGp0odvw3jrMPYMTNSU7VydTDtZ8+VfCeNp\r
+       +eGw==\r
+X-Gm-Message-State:\r
+ ALoCoQm7Afkcz9jnMPw1mtAUg3sOhXf4wbFroXNtCToZYefTOlolfQE+QbboqqSAJa4Boqwdl2D4\r
+X-Received: by 10.195.11.132 with SMTP id ei4mr160528wjd.133.1407789520710;\r
+       Mon, 11 Aug 2014 13:38:40 -0700 (PDT)\r
+Received: from moritz-x230 (port-92-204-16-141.dynamic.qsc.de.\r
+ [92.204.16.141])      by mx.google.com with ESMTPSA id\r
+       bf3sm47754706wib.18.2014.08.11.13.38.26 for <notmuch@notmuchmail.org>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);      Mon, 11\r
+ Aug 2014 13:38:39 -0700 (PDT)\r
+From: Moritz Ulrich <moritz@tarn-vedra.de>\r
+To: notmuch@notmuchmail.org\r
+Subject: `notmuch-escape-boolean-term': Broken for non-ascii characters\r
+User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+Date: Mon, 11 Aug 2014 22:38:16 +0200\r
+Message-ID: <874mxiu5hj.fsf@tarn-vedra.de>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha256; protocol="application/pgp-signature"\r
+X-Mailman-Approved-At: Tue, 12 Aug 2014 03:47:09 -0700\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 11 Aug 2014 20:38:53 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+\r
+Hello,\r
+\r
+I recently adopted notmuch as my primary way to read mail, so thank you\r
+for this great tool!\r
+\r
+Unfortunately, I ran into a problem of the Emacs side of the project\r
+when used in a non-ascii environment:\r
+\r
+Having a tag named 'uni-k=C3=B6ln', the tag:-completion doesn't work.\r
+\r
+This is caused by `notmuch-escape-boolean-term' errornously escaping the\r
+above string:\r
+\r
+(notmuch-escape-boolean-term "uni-k=C3=B6ln") =3D> "\"uni-k=C3=B6ln\""\r
+\r
+This is caused by `string-match' with the following errornously matching\r
+my tag:\r
+\r
+(string-match "[^!#-'*-~]" "uni-k=C3=B6ln") =3D> 5\r
+(string-match "[^!#-'*-~]" "uni-koln") =3D> nil\r
+\r
+I'm not exactly sure how to tackle this - the Regexp was crafted to match\r
+(, ), " if I understand it correct. A simple way would be just adding\r
+more characters as a sort-of whitelist. A nicer solution would be\r
+converting it from [^...] to [...] to explicitly mark letters that needs\r
+to be escaped.\r
+\r
+Cheers,\r
+Moritz Ulrich\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2\r
+\r
+iQIcBAEBCAAGBQJT6Sm9AAoJEKnhzHnsv6Qyp/MP/2AxFLNbuE8OazOaqDuNWR//\r
+fegXTAYkLHYYsd+pzLQgFuqC2mF4vh0hFM3cWJJTyoASzUBEM239nj1jLuloDSVv\r
+YcGBo+HBO4cqir9ly2UTLH9SkcEghx5zScfjVIygjZWwIFZRCjsfyXD5rK74Cv38\r
+4pi/LTEfX4CulQv3LwAGGZtN0ez+GP1fS7nWDNxUVO+tREJYg4S2sinSOmBPKaua\r
+lgkWEAXTJDj12FUijkR9RHcE5TviVXaW2n4mf833hvvbhHslaRic7fbmX56Sny40\r
+UaLkeJtoTF61yfoL2gazo5LjqQbBrrOzvGa5xHZhwtEnFNY9qlu8lxtdonhr63eK\r
+esVCaA+Q2D1lhw4JEPXgy1NcPHEp5x3CP/Dno8eXzK5+s2f85oFVX4cZREm+STc1\r
+7MWxSWOBshn8+QtStK4a4RIGgLnq5XoH8QBWi/Vh1ug30DBRsMfnXbLbiz6DrWf6\r
+koV3DnWcaVxbVQKXaSl/4DGzfbr1C4DO4S5nnjM40Aa1zfaUz64qxATKff0ZsIqN\r
+yN/Fll2SXJEdSRTH3F1sFrxWbVl7/5Taf9xyOsggjF5EPGXR9Ykxks9K+sTT3f1e\r
+Bp3EM4UZyyPepwTUU/KfgufC6yL6/GxEtx4KSuAlfvBoDCQpJyQ6OYyUjwruGIoH\r
+3K5sXP5xLAQVX4FyMxVe\r
+=9eCy\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r