Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / 43 / f0f4800d051a6cd6d18cf3d74235e9fbcbcc17
1 Return-Path: <amdragon@mit.edu>\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 1CB05429E47\r
6         for <notmuch@notmuchmail.org>; Tue, 22 Oct 2013 17:22:26 -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 heQ7byy5Xm9t for <notmuch@notmuchmail.org>;\r
16         Tue, 22 Oct 2013 17:22:20 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
18         [18.9.25.13])\r
19         by olra.theworths.org (Postfix) with ESMTP id 57CCC429E27\r
20         for <notmuch@notmuchmail.org>; Tue, 22 Oct 2013 17:22:08 -0700 (PDT)\r
21 X-AuditID: 1209190d-b7f528e0000009b4-6f-526716aeed4a\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id DB.30.02484.EA617625; Tue, 22 Oct 2013 20:22:06 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r9N0M4uT017160; \r
27         Tue, 22 Oct 2013 20:22:05 -0400\r
28 Received: from drake.dyndns.org\r
29         (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [216.15.114.40]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r9N0M3A6005833\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Tue, 22 Oct 2013 20:22:04 -0400\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
36         (envelope-from <amdragon@mit.edu>)\r
37         id 1VYmD5-0008KA-EU; Tue, 22 Oct 2013 20:22:03 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH v2 0/8] Improve tag change completion\r
41 Date: Tue, 22 Oct 2013 20:21:53 -0400\r
42 Message-Id: <1382487721-31776-1-git-send-email-amdragon@mit.edu>\r
43 X-Mailer: git-send-email 1.8.4.rc3\r
44 X-Brightmail-Tracker:\r
45  H4sIAAAAAAAAA+NgFlrIIsWRmVeSWpSXmKPExsUixG6nrrtOLD3IYN9SAYvVc3ksrt+cyezA\r
46         5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZZx/fIilYJJwRfOqhawNjH/5uxg5OSQETCRO\r
47         z29mhrDFJC7cW8/WxcjFISSwj1Hiw5bPLF2MHEDORkaJrWYQ8TtMEhd7b7FDOHMZJToPr2AC\r
48         6WYT0JDYtn85I4gtIiAtsfPubFYQm1lAVuLH+T+sIIOEBUwlHhzyAzFZBFQlfhzUAqngFXCQ\r
49         +LnoIhPEDUoSC09tY53AyLuAkWEVo2xKbpVubmJmTnFqsm5xcmJeXmqRrpFebmaJXmpK6SZG\r
50         UEhwSvLuYHx3UOkQowAHoxIPr0V7WpAQa2JZcWXuIUZJDiYlUV51/vQgIb6k/JTKjMTijPii\r
51         0pzU4kOMEhzMSiK8zb5A5bwpiZVVqUX5MClpDhYlcd6bHPZBQgLpiSWp2ampBalFMFkZDg4l\r
52         CV5fUaChgkWp6akVaZk5JQhpJg5OkOE8QMNXgNTwFhck5hZnpkPkTzEqSonz8oMkBEASGaV5\r
53         cL2wmH3FKA70ijDvFxGgKh5gvMN1vwIazAQ0eMoSkKuLSxIRUlINjGlfvu4/5nDq7P3ah41/\r
54         0+xP6e8SYN2rrTJBXvVAleUk3f35zafqsx/saPYXZHslWHTrX8NGTbYNB338J6+acsXvaqhs\r
55         q+XSP7oHXc4zdk1lubt/47Sti5adDGeZupz97nqbnD/HtHkPbz03WcLg0S3dtw3bTH9q1tto\r
56         T/7WtUI2ZfuPS4e9m7KVWIozEg21mIuKEwFaehDbtAIAAA==\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Wed, 23 Oct 2013 00:22:26 -0000\r
70 \r
71 This is v2 of id:1382471457-26056-1-git-send-email-amdragon@mit.edu.\r
72 It improves some documentation strings, fixes one bug, and elimintes\r
73 some redundant code.  The diff from v1 is below.\r
74 \r
75 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
76 index ef77839..f66d669 100644\r
77 --- a/emacs/notmuch-show.el\r
78 +++ b/emacs/notmuch-show.el\r
79 @@ -1800,7 +1800,6 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."\r
80     (list (let (tags)\r
81            (notmuch-show-mapc\r
82             (lambda () (setq tags (append (notmuch-show-get-tags) tags))))\r
83 -          (delete-dups tags)\r
84            (notmuch-read-tag-changes tags "Tag thread"))))\r
85    (notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)\r
86    (notmuch-show-mapc\r
87 diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
88 index feee17c..7b21006 100644\r
89 --- a/emacs/notmuch-tag.el\r
90 +++ b/emacs/notmuch-tag.el\r
91 @@ -189,6 +189,9 @@ the messages that were tagged"\r
92  `notmuch-read-tag-changes' function.")\r
93  \r
94  (defun notmuch-tag-completions (&rest search-terms)\r
95 +  "Return a list of tags for messages matching SEARCH-TERMS.\r
96 +\r
97 +Returns all tags if no search terms are given."\r
98    (if (null search-terms)\r
99        (setq search-terms (list "*")))\r
100    (split-string\r
101 @@ -199,7 +202,7 @@ the messages that were tagged"\r
102     "\n+" t))\r
103  \r
104  (defun notmuch-select-tag-with-completion (prompt &rest search-terms)\r
105 -  (let ((tag-list (notmuch-tag-completions search-terms)))\r
106 +  (let ((tag-list (apply #'notmuch-tag-completions search-terms)))\r
107      (completing-read prompt tag-list nil nil nil 'notmuch-select-tag-history)))\r
108  \r
109  (defun notmuch-read-tag-changes (current-tags &optional prompt initial-input)\r
110 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
111 index 5492e1b..53e9826 100644\r
112 --- a/emacs/notmuch.el\r
113 +++ b/emacs/notmuch.el\r
114 @@ -584,7 +584,10 @@ Returns (TAG-CHANGES REGION-BEGIN REGION-END)."\r
115    "Change tags for the currently selected thread or region.\r
116  \r
117  See `notmuch-tag' for information on the format of TAG-CHANGES.\r
118 -If BEG or END are nil, applies to the thread at point."\r
119 +When called interactively, this uses the region if the region is\r
120 +active.  When called directly, BEG and END provide the region.\r
121 +If these are nil or not provided, this applies to the thread at\r
122 +point."\r
123    (interactive (notmuch-search-interactive-tag-changes))\r
124    (unless (and beg end) (setq beg (point) end (point)))\r
125    (let ((search-string (notmuch-search-find-thread-id-region-search beg end)))\r
126 \r
127 \r