Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 37 / a32312664dec64b31db0fec97acb2d4803b9d5
1 Return-Path: <tomi.ollila@iki.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 1F2BA431FBC\r
6         for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 13:21:17 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id y2tYR9iD5gVM for <notmuch@notmuchmail.org>;\r
16         Mon,  3 Feb 2014 13:21:09 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 618DC431FAF\r
19         for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 13:21:09 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id DED2E100033;\r
22         Mon,  3 Feb 2014 23:21:03 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
25 Subject: Re: sanitization of args notmuch-cli in notmuch-emacs\r
26 In-Reply-To: <m2mwi8q6gh.fsf@guru.guru-group.fi>\r
27 References: <87wqhcxb5j.fsf@maritornes.cs.unb.ca>\r
28         <m2mwi8q6gh.fsf@guru.guru-group.fi>\r
29 User-Agent: Notmuch/0.17+55~g4397960 (http://notmuchmail.org) Emacs/24.3.1\r
30         (x86_64-unknown-linux-gnu)\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
32         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
33         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
34 Date: Mon, 03 Feb 2014 23:21:03 +0200\r
35 Message-ID: <m2sirzj3k0.fsf@guru.guru-group.fi>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain; charset=utf-8\r
38 Content-Transfer-Encoding: quoted-printable\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Mon, 03 Feb 2014 21:21:17 -0000\r
52 \r
53 On Mon, Feb 03 2014, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
54 \r
55 > On Mon, Feb 03 2014, David Bremner <david@tethera.net> wrote:\r
56 >\r
57 >> Antoine Beaupr=C3=A9 found a bug when notmuch-saved-searches contains=20\r
58 >> newlines:\r
59 >>\r
60 >>         http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D737496\r
61 >>\r
62 >> We can remove newlines with something like\r
63 >>=20=20=20=20=20=20=20=20=20=20=20\r
64 >> (mapcar (lambda (arg)=20\r
65 >>        (replace-regexp-in-string "\n" " " arg))\r
66 >>      args)\r
67 >>\r
68 >> I wonder if we should do some other sanitization at the same time?\r
69 >\r
70 > It took a while to reproduce...\r
71 >\r
72 > $ echo $'foo\nbar' | notmuch count --batch=20\r
73 > 665\r
74 > 631\r
75 >\r
76 > $ echo $'foo\n and bar' | notmuch count --batch\r
77 > 665\r
78 > A Xapian exception occurred: Syntax: <expression> AND <expression>\r
79 > Query string was:  and bar\r
80 > 0\r
81 >\r
82 > Therefore: (wrong-type-argument number-or-marker-p A)\r
83 >\r
84 > (I run non-byte-compiled version of (one-) notmuch.el and\r
85 > got this as a backtrace:\r
86 >\r
87 > Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p A)\r
88 >   >(A 0)\r
89 >   (or (plist-get options :show-empty-searches) (> message-count 0))\r
90 > ...\r
91 >   (notmuch-remove-if-not\r
92 > ...\r
93 >   notmuch-hello-query-counts\r
94 > ...\r
95 >\r
96 > simpler way to reproduce:\r
97 >\r
98 > $ notmuch count 'and bar'\r
99 > A Xapian exception occurred: Syntax: <expression> AND <expression>\r
100 > Query string was: and bar\r
101 > 0\r
102 >\r
103 > Maybe the cli should be fixed ? (and/or make emacs MUA resilient to\r
104 > this kind of result)\r
105 \r
106 of yes, the notmuch count --batch gets borken with \n -- from one\r
107 query there are 2 new count queries (and counts should be all wrong\r
108 from that point on (if there were no Xapian exception))\r
109 \r
110 We would not have noticed this (as easily) if the Xapian execption did not\r
111 happen.\r
112 \r
113 So, whether (or not?) some fixing is done in CLI the batch query emacs\r
114 sends needs to be sanitized exactly as David suggested above.\r
115 \r
116 >\r
117 >>\r
118 >> d\r
119 >>\r
120 >\r
121 > Tomi\r
122 \r
123 Tomi\r
124 \r