[PATCH v3 9/9] lib: Remove unnecessary thread linking steps when using ghost messages
[notmuch-archives.git] / bb / 28fe3ed32d95dd2bf646631a674a58a6f78c0d
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 3EA9A431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 27 Jan 2012 20:42:52 -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 jtmPsmEs0qhf for <notmuch@notmuchmail.org>;\r
17         Fri, 27 Jan 2012 20:42:51 -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 13716431FD6\r
22         for <notmuch@notmuchmail.org>; Fri, 27 Jan 2012 20:42:41 -0800 (PST)\r
23 Received: by mail-bk0-f53.google.com with SMTP id zt19so2255515bkb.26\r
24         for <notmuch@notmuchmail.org>; Fri, 27 Jan 2012 20:42:41 -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:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=r4I6h0mr3Myu6qCDKlGpxaLIAf6a0DVhKJQcJez/elI=;\r
28         b=wJQDmFi36s7lKMxrZ/cMBINSsIBdrvFO64qYQ/93IosUmmW4Kjw5KrZ7ACkcKOp7hs\r
29         He6aV7Wves8jQPRTKE2scxYJT/3p3ZZyX65ZqR9NxOrYxSsjKIeaeFH+YNEe3X/A6f9V\r
30         V/qvi2vmFfxsachM3nifmdTKVvn094HL3tCVM=\r
31 Received: by 10.204.157.25 with SMTP id z25mr4294521bkw.25.1327725761792;\r
32         Fri, 27 Jan 2012 20:42:41 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id bw9sm20679266bkb.8.2012.01.27.20.42.40\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Fri, 27 Jan 2012 20:42:41 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH 6/6] emacs: separate history for operations which accept\r
40         single and multiple tags\r
41 Date: Sat, 28 Jan 2012 08:41:24 +0400\r
42 Message-Id: <1327725684-5887-6-git-send-email-dmitry.kurochkin@gmail.com>\r
43 X-Mailer: git-send-email 1.7.8.3\r
44 In-Reply-To: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45 References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Sat, 28 Jan 2012 04:42:52 -0000\r
59 \r
60 Some tag-related operations accept a single tag without prefix\r
61 (`notmuch-select-tag-with-completion'), others accept multiple tags\r
62 prefixed with '+' or '-' (`notmuch-select-tags-with-completion').\r
63 Before the change, both functions used a single default minibuffer\r
64 history.  This is inconvenient because you have to skip options with\r
65 incompatible format when going through the history.  The patch adds\r
66 separate history lists for the two functions.  Note that functions\r
67 that accept the same input format (e.g. "+", "-", "*") share the\r
68 history list as before.\r
69 ---\r
70  emacs/notmuch.el |   12 ++++++++++--\r
71  1 files changed, 10 insertions(+), 2 deletions(-)\r
72 \r
73 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
74 index 24b0ea3..9813e0a 100644\r
75 --- a/emacs/notmuch.el\r
76 +++ b/emacs/notmuch.el\r
77 @@ -76,6 +76,14 @@ For example:\r
78  (defvar notmuch-query-history nil\r
79    "Variable to store minibuffer history for notmuch queries")\r
80  \r
81 +(defvar notmuch-select-tag-history nil\r
82 +  "Variable to store notmuch tag history for\r
83 +  `notmuch-select-tag-with-completion'.")\r
84 +\r
85 +(defvar notmuch-select-tags-history nil\r
86 +  "Variable to store notmuch tags history for\r
87 +  `notmuch-select-tags-with-completion'.")\r
88 +\r
89  (defun notmuch-tag-completions (&optional search-terms)\r
90    (split-string\r
91     (with-output-to-string\r
92 @@ -86,7 +94,7 @@ For example:\r
93  \r
94  (defun notmuch-select-tag-with-completion (prompt &rest search-terms)\r
95    (let ((tag-list (notmuch-tag-completions search-terms)))\r
96 -    (completing-read prompt tag-list)))\r
97 +    (completing-read prompt tag-list nil nil nil 'notmuch-select-tag-history)))\r
98  \r
99  (defun notmuch-select-tags-with-completion (&optional initial-input &rest search-terms)\r
100    (let* ((add-tag-list (mapcar (apply-partially 'concat "+")\r
101 @@ -105,7 +113,7 @@ For example:\r
102             map)))\r
103      (delete "" (completing-read-multiple\r
104                 "Operations (+add -drop): notmuch tag " tag-list nil\r
105 -               nil initial-input))))\r
106 +               nil initial-input 'notmuch-select-tags-history))))\r
107  \r
108  (defun notmuch-update-tags (current-tags changed-tags)\r
109    "Update `current-tags' with `changed-tags' and return the result.\r
110 -- \r
111 1.7.8.3\r
112 \r