Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 25 / 056e72b89ba704fd06811310853b7f6b556c47
1 Return-Path: <jrollins@finestructure.net>\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 89A9640F1ED\r
6         for <notmuch@notmuchmail.org>; Sat,  7 Jan 2012 14:28: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: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 IiyOQXMRMMdN for <notmuch@notmuchmail.org>;\r
16         Sat,  7 Jan 2012 14:28:25 -0800 (PST)\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
18         [131.215.239.19])\r
19         by olra.theworths.org (Postfix) with ESMTP id BA0E940F21F\r
20         for <notmuch@notmuchmail.org>; Sat,  7 Jan 2012 14:28:23 -0800 (PST)\r
21 Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by fire-doxen-postvirus (Postfix) with ESMTP id 6611B2E50DCE\r
23         for <notmuch@notmuchmail.org>; Sat,  7 Jan 2012 14:28:23 -0800 (PST)\r
24 X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
25 Received: from finestructure.net (cpe-76-174-137-84.socal.res.rr.com\r
26         [76.174.137.84]) (Authenticated sender: jrollins)\r
27         by fire-doxen-submit (Postfix) with ESMTP id 8A73C2E50DE4\r
28         for <notmuch@notmuchmail.org>; Sat,  7 Jan 2012 14:28:21 -0800 (PST)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id D16311118; Sat,  7 Jan 2012 14:28:20 -0800 (PST)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>\r
33 Subject: [PATCH 2/4] emacs: repurpose notmuch-show-archive-thread-internal\r
34         function for general thread tagging\r
35 Date: Sat,  7 Jan 2012 14:28:12 -0800\r
36 Message-Id: <1325975294-646-3-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.7.3\r
38 In-Reply-To: <1325975294-646-2-git-send-email-jrollins@finestructure.net>\r
39 References: <1325975294-646-1-git-send-email-jrollins@finestructure.net>\r
40         <1325975294-646-2-git-send-email-jrollins@finestructure.net>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Sat, 07 Jan 2012 22:28:26 -0000\r
54 \r
55 Instead of having a function that is only used for archiving a thread,\r
56 we instead make it useful for any tagging operation.  The new\r
57 function, notmuch-show-tag-thread-internal, now takes two more\r
58 arguments, for the "sign" of the tagging operation ("-" or "+"), and\r
59 the tag to be added or removed.  This will allow this function to be\r
60 used for any generic thread tagging operation.\r
61 \r
62 The higher level functions that call this function are modified\r
63 accordingly.\r
64 ---\r
65  emacs/notmuch-show.el |   34 ++++++++++++++++++++--------------\r
66  1 files changed, 20 insertions(+), 14 deletions(-)\r
67 \r
68 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
69 index 5502efd..1e16f05 100644\r
70 --- a/emacs/notmuch-show.el\r
71 +++ b/emacs/notmuch-show.el\r
72 @@ -1414,20 +1414,26 @@ argument, hide all of the messages."\r
73    (interactive)\r
74    (backward-button 1))\r
75  \r
76 -(defun notmuch-show-archive-thread-internal (show-next)\r
77 +(defun notmuch-show-tag-thread-internal (sign tag show-next)\r
78    ;; Remove the tag from the current set of messages.\r
79    (goto-char (point-min))\r
80 -  (loop do (notmuch-show-remove-tag "inbox")\r
81 -       until (not (notmuch-show-goto-message-next)))\r
82 -  ;; Move to the next item in the search results, if any.\r
83 -  (let ((parent-buffer notmuch-show-parent-buffer))\r
84 -    (notmuch-kill-this-buffer)\r
85 -    (if parent-buffer\r
86 -       (progn\r
87 -         (switch-to-buffer parent-buffer)\r
88 -         (forward-line)\r
89 -         (if show-next\r
90 -             (notmuch-search-show-thread))))))\r
91 +  (let ((tag-function))\r
92 +    (cond\r
93 +     ((string= sign "-")\r
94 +      (setq tag-function 'notmuch-show-remove-tag))\r
95 +     ((string= sign "+")\r
96 +      (setq tag-function 'notmuch-show-add-tag)))\r
97 +    (loop do (funcall tag-function tag)\r
98 +         until (not (notmuch-show-goto-message-next)))\r
99 +    ;; Move to the next item in the search results, if any.\r
100 +    (let ((parent-buffer notmuch-show-parent-buffer))\r
101 +      (notmuch-kill-this-buffer)\r
102 +      (if parent-buffer\r
103 +         (progn\r
104 +           (switch-to-buffer parent-buffer)\r
105 +           (forward-line)\r
106 +           (if show-next\r
107 +               (notmuch-search-show-thread)))))))\r
108  \r
109  (defun notmuch-show-archive-thread ()\r
110    "Archive each message in thread, then show next thread from search.\r
111 @@ -1441,12 +1447,12 @@ being delivered to the same thread. It does not archive the\r
112  entire thread, but only the messages shown in the current\r
113  buffer."\r
114    (interactive)\r
115 -  (notmuch-show-archive-thread-internal t))\r
116 +  (notmuch-show-tag-thread-internal "-" "inbox" t))\r
117  \r
118  (defun notmuch-show-archive-thread-then-exit ()\r
119    "Archive each message in thread, then exit back to search results."\r
120    (interactive)\r
121 -  (notmuch-show-archive-thread-internal nil))\r
122 +  (notmuch-show-tag-thread-internal "-" "inbox" nil))\r
123  \r
124  (defun notmuch-show-stash-cc ()\r
125    "Copy CC field of current message to kill-ring."\r
126 -- \r
127 1.7.7.3\r
128 \r