Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / 6c / 3f242101c9a14a49336d28d3e866f89893d791
1 Return-Path: <dme@dme.org>\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 141B1431FBC\r
6         for <notmuch@notmuchmail.org>; Mon, 19 May 2014 09:09:28 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 e-OCpqxzafbN for <notmuch@notmuchmail.org>;\r
16         Mon, 19 May 2014 09:09:24 -0700 (PDT)\r
17 Received: from mail-we0-f171.google.com (mail-we0-f171.google.com\r
18         [74.125.82.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id C9642431FAF\r
21         for <notmuch@notmuchmail.org>; Mon, 19 May 2014 09:09:23 -0700 (PDT)\r
22 Received: by mail-we0-f171.google.com with SMTP id w62so5798167wes.16\r
23         for <notmuch@notmuchmail.org>; Mon, 19 May 2014 09:09:19 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:subject:date:message-id;\r
27         bh=6DaI1fcCp1FrHP2fUzpI4hqGpX29SDdZWiXouuu7r68=;\r
28         b=a1yf9f32/6xLtnm4cf5xTXrvjIWbAdPTIV8roujA/3YHuSSXvlRKKqwuY63Ye1rDx4\r
29         3213AHnsoGFzsR3TCkwEsZRnF1hehOAtYl3ntaaMBJbILjrkxsbXGtIh1h99kLqXNU1+\r
30         ZHdtpDiI8T1OUZMXxtkTEjhrbyzXVdg/1o1toGJhe/r45D8GHD2abFqejZvtD3UNdFjk\r
31         SWYFN51SUQmmZ2hlqffv4WfjYIvOXKZzOUVvRZ7kpz/8SeV3KkCREUipwnLVtk+AXdzZ\r
32         KhWva646ixBSJl2clRLDq0HLAx5U0e/kcXU/yf18hKYEPJh6Q/cOGgsulYyWBq4SPKH8\r
33         1Tig==\r
34 X-Gm-Message-State:\r
35  ALoCoQn0pTjvBNCNDqY0o1OOTG8+2mSSPBwLwX0yrrDJAWZ+qXodtECvviwNf5+qEDnUKNHk8v4C\r
36 X-Received: by 10.180.11.196 with SMTP id s4mr3305804wib.34.1400515759536;\r
37         Mon, 19 May 2014 09:09:19 -0700 (PDT)\r
38 Received: from hotblack-desiato.hh.sledj.net\r
39         ([2a01:348:1a2:1:a288:b4ff:fe8a:77d8])\r
40         by mx.google.com with ESMTPSA id\r
41         nb8sm15760615wic.18.2014.05.19.09.09.17 for <notmuch@notmuchmail.org>\r
42         (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
43         Mon, 19 May 2014 09:09:18 -0700 (PDT)\r
44 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
45         id 8CD9410FF2D; Mon, 19 May 2014 17:09:16 +0100 (BST)\r
46 From: David Edmondson <dme@dme.org>\r
47 To: notmuch@notmuchmail.org\r
48 Subject: [PATCH v1] emacs: `notmuch-search-find-stable-query-region' should\r
49         never return an empty query.\r
50 Date: Mon, 19 May 2014 17:09:16 +0100\r
51 Message-Id: <1400515756-31779-1-git-send-email-dme@dme.org>\r
52 X-Mailer: git-send-email 2.0.0.rc0\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Mon, 19 May 2014 16:09:28 -0000\r
66 \r
67 `notmuch-search-find-stable-query-region' is expected to examine the\r
68 region between `beg' and `end' to generate a query that can be used to\r
69 include all threads in that region. If the region contains no threads,\r
70 it should throw an error rather than generating an empty query.\r
71 ---\r
72 \r
73 Whilst logging calls to 'notmuch' from the UI, I noticed that it would generate\r
74   notmuch tag -inbox -- ()\r
75 if I hit 'a' at the very end of a search buffer. That seems at least\r
76 useless and possibly bad, so flag an error in this case instead.\r
77 \r
78 Oh, the first bit is just cleanup.\r
79 \r
80  emacs/notmuch.el | 5 ++++-\r
81  1 file changed, 4 insertions(+), 1 deletion(-)\r
82 \r
83 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
84 index 8aa0104..74103a6 100644\r
85 --- a/emacs/notmuch.el\r
86 +++ b/emacs/notmuch.el\r
87 @@ -429,12 +429,15 @@ matched and unmatched messages in the current thread."\r
88  \r
89  If ONLY-MATCHED is non-nil, include only matched messages.  If it\r
90  is nil, include both matched and unmatched messages."\r
91 -  (let ((query-list nil) (all (not only-matched)))\r
92 +  (let ((all (not only-matched))\r
93 +       query-list)\r
94      (dolist (queries (notmuch-search-properties-in-region :query beg end))\r
95        (when (first queries)\r
96         (push (first queries) query-list))\r
97        (when (and all (second queries))\r
98         (push (second queries) query-list)))\r
99 +    (unless query-list\r
100 +      (error "No threads in region."))\r
101      (concat "(" (mapconcat 'identity query-list ") or (") ")")))\r
102  \r
103  (defun notmuch-search-find-authors ()\r
104 -- \r
105 2.0.0.rc0\r
106 \r