From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1E98F431FBD for ; Sat, 8 Feb 2014 10:31:31 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1+J+UfApdreY for ; Sat, 8 Feb 2014 10:31:25 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 871F3431FBC for ; Sat, 8 Feb 2014 10:31:25 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id B89DC100033; Sat, 8 Feb 2014 20:31:17 +0200 (EET) From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: remove newlines from input to notmuch count --batch In-Reply-To: <1391869517-2742-1-git-send-email-david@tethera.net> References: <1391869517-2742-1-git-send-email-david@tethera.net> User-Agent: Notmuch/0.17+69~g761b031 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 18:31:31 -0000 On Sat, Feb 08 2014, David Bremner wrote: > Since a newline starts a new query in batch mode, this causes > mysterious crashes in the emacs interface if saved searches contain > newlines. See the discussion at > > id:87wqhcxb5j.fsf@maritornes.cs.unb.ca > > In general newlines seem to be just whitespace to the xapian query > parser, so this should be mainly harmless. > --- LGTM. Tomi > emacs/notmuch-hello.el | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el > index 7b3d76b..e325cd3 100644 > --- a/emacs/notmuch-hello.el > +++ b/emacs/notmuch-hello.el > @@ -399,10 +399,12 @@ options will be handled as specified for > (third elem) > (cdr elem)))) > (insert > - (notmuch-hello-filtered-query count-query > - (or (plist-get options :filter-count) > - (plist-get options :filter))) > - "\n"))) > + (replace-regexp-in-string > + "\n" " " > + (notmuch-hello-filtered-query count-query > + (or (plist-get options :filter-count) > + (plist-get options :filter)))) > + "\n"))) > > (unless (= (call-process-region (point-min) (point-max) notmuch-command > t t nil "count" "--batch") 0) > -- > 1.8.5.2 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch