[PATCH v3 5/7] Introduce _notmuch_message_has_term()
[notmuch-archives.git] / 86 / b6321a2a71b4ce78c28e98d9b22c9f53686d5f
1 Return-Path: <dmitry.kurochkin@gmail.com>\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 0B83F431FAF\r
6         for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 09:58:26 -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.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id dIve49DlgXQz for <notmuch@notmuchmail.org>;\r
17         Wed, 18 Jan 2012 09:58:25 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 3E3D6431FAE\r
22         for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 09:58:25 -0800 (PST)\r
23 Received: by bkty12 with SMTP id y12so1947394bkt.26\r
24         for <notmuch@notmuchmail.org>; Wed, 18 Jan 2012 09:58:24 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type;\r
28         bh=m3pCFKw+OTFdzVg6YhxjyEamF/D+ejUM/BiZ574a2WE=;\r
29         b=lL6I+gakHfP/LoiBamFu7jmG0H0ygeeLz0O5M8gLva3KMjQRpLu4LGl/w6TIxn3L+D\r
30         IYcXB28lT+B7LQgDus5zOXXkxnO2acaFAJ6k+4zeBDa4dJxNC7OP0KF7G8ELPv8TLvdJ\r
31         EGagyJJNz8GZuhQQMNFpHEcihRguwhbqKrVJQ=\r
32 Received: by 10.204.145.72 with SMTP id c8mr8619109bkv.79.1326909503926;\r
33         Wed, 18 Jan 2012 09:58:23 -0800 (PST)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id e12sm56352324bko.14.2012.01.18.09.58.22\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Wed, 18 Jan 2012 09:58:23 -0800 (PST)\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
39 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
40 Subject: Re: [PATCH 2/3] emacs: use a single history for all searches\r
41 In-Reply-To: <cuny5t5mn7x.fsf@hotblack-desiato.hh.sledj.net>\r
42 References: <1326828850-8519-1-git-send-email-dmitry.kurochkin@gmail.com>\r
43         <1326828850-8519-2-git-send-email-dmitry.kurochkin@gmail.com>\r
44         <cuny5t5mn7x.fsf@hotblack-desiato.hh.sledj.net>\r
45 User-Agent: Notmuch/0.11+73~g8a5402e (http://notmuchmail.org) Emacs/23.3.1\r
46         (x86_64-pc-linux-gnu)\r
47 Date: Wed, 18 Jan 2012 21:57:27 +0400\r
48 Message-ID: <87boq099mg.fsf@gmail.com>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain; charset=us-ascii\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Wed, 18 Jan 2012 17:58:26 -0000\r
64 \r
65 On Wed, 18 Jan 2012 08:25:22 +0000, David Edmondson <dme@dme.org> wrote:\r
66 > On Tue, 17 Jan 2012 23:34:09 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
67 > > There are two ways to do search in Emacs UI: search widget in\r
68 > > notmuch-hello buffer and `notmuch-search' function bound to "s".\r
69 > > Before the change, these search mechanisms used different history\r
70 > > lists.  The patch makes notmuch-hello search use the same history list\r
71 > > as `notmuch-search' function.\r
72\r
73 > The test output updates included here should be with the previous patch,\r
74 > shouldn't they?\r
75\r
76 \r
77 Indeed.  Would send v2.\r
78 \r
79 > > -(defun notmuch-search (query &optional oldest-first target-thread target-line continuation)\r
80 > > -  "Run \"notmuch search\" with the given query string and display results.\r
81 > > +(defun notmuch-search (&optional query oldest-first target-thread target-line continuation)\r
82 > > +  "Run \"notmuch search\" with the given `query' and display results.\r
83 > >  \r
84 > > -The optional parameters are used as follows:\r
85 > > +If `query' is nil, it is read interactively from the minibuffer.\r
86 > > +Other optional parameters are used as follows:\r
87 > >  \r
88 > >    oldest-first: A Boolean controlling the sort order of returned threads\r
89 > >    target-thread: A thread ID (with the thread: prefix) that will be made\r
90 > >                   current if it appears in the search results.\r
91 > >    target-line: The line number to move to if the target thread does not\r
92 > >                 appear in the search results."\r
93 > > -  (interactive (list (notmuch-read-query "Notmuch search: ")))\r
94 > > +  (interactive)\r
95 > > +  (if (null query)\r
96 > > +      (setq query (notmuch-read-query "Notmuch search: "))\r
97 > > +    (setq query (notmuch-trim query))\r
98 > > +    (let ((history-delete-duplicates t))\r
99 > > +      (add-to-history 'notmuch-search-history query)))\r
100\r
101 > Should user-typed queries be trimmed?\r
102 \r
103 IMO that would not hurt.  But we need to do it before it gets added to\r
104 the history.  And that may be tricky.  So this patch does trimming only\r
105 for queries from notmuch-hello search box (as it was before).\r
106 \r
107 Regards,\r
108   Dmitry\r