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 C2EE9431FAF
\r
6 for <notmuch@notmuchmail.org>; Wed, 8 Feb 2012 08:50:12 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 EAKr1diHCgEL for <notmuch@notmuchmail.org>;
\r
17 Wed, 8 Feb 2012 08:50:12 -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 23232431FAE
\r
22 for <notmuch@notmuchmail.org>; Wed, 8 Feb 2012 08:50:12 -0800 (PST)
\r
23 Received: by bkcjk7 with SMTP id jk7so798174bkc.26
\r
24 for <notmuch@notmuchmail.org>; Wed, 08 Feb 2012 08:50:09 -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;
\r
27 bh=x8A2tivaQCvZBXg70cTV1JoFcEumr7yZNVwCXMcNkfg=;
\r
28 b=Z96Mxbb4BrY850bHCL3vdahN0XOzwwthUQB1YNTOaLJ2QmSbnAaPXKm6A0RRghkiQN
\r
29 V7nJgsunDy8xGYh6o05RdqB3J1HkVZz2JWsx7Th+ZXT0mRd5kz+9+q66UqM2PY06Kp65
\r
30 6wqEfpE8AXo6qbC+4tQyPmQJ45Yz99cM97MSI=
\r
31 Received: by 10.205.120.132 with SMTP id fy4mr12882370bkc.23.1328719809241;
\r
32 Wed, 08 Feb 2012 08:50:09 -0800 (PST)
\r
33 Received: from localhost ([91.144.186.21])
\r
34 by mx.google.com with ESMTPS id sp6sm6222856bkb.2.2012.02.08.08.50.08
\r
35 (version=TLSv1/SSLv3 cipher=OTHER);
\r
36 Wed, 08 Feb 2012 08:50:08 -0800 (PST)
\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH] emacs: cleanup and simplify `notmuch-show-archive-thread' and
\r
41 Date: Wed, 8 Feb 2012 20:48:51 +0400
\r
42 Message-Id: <1328719731-13402-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
43 X-Mailer: git-send-email 1.7.9
\r
44 X-BeenThere: notmuch@notmuchmail.org
\r
45 X-Mailman-Version: 2.1.13
\r
47 List-Id: "Use and development of the notmuch mail system."
\r
48 <notmuch.notmuchmail.org>
\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
52 List-Post: <mailto:notmuch@notmuchmail.org>
\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
56 X-List-Received-Date: Wed, 08 Feb 2012 16:50:12 -0000
\r
58 Recent changes in notmuch-show tagging introduced some code
\r
59 duplication. The patch cleanups and simplifies
\r
60 `notmuch-show-archive-thread' function by using
\r
61 `notmuch-show-tag-all', no longer used function are removed. After
\r
62 the change, `notmuch-show-archive-thread' function becomes symmetric
\r
63 with `notmuch-show-archive-message'.
\r
65 A side effect of these changes is that `notmuch-show-archive-thread'
\r
66 no longer calls "notmuch tag" for each message in the thread.
\r
68 emacs/notmuch-show.el | 25 ++-----------------------
\r
69 1 files changed, 2 insertions(+), 23 deletions(-)
\r
71 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
72 index faa9f9b..8199f56 100644
\r
73 --- a/emacs/notmuch-show.el
\r
74 +++ b/emacs/notmuch-show.el
\r
75 @@ -1598,26 +1598,6 @@ argument, hide all of the messages."
\r
77 (backward-button 1))
\r
79 -(defun notmuch-show-tag-thread-internal (tag &optional remove)
\r
80 - "Add tag to the current set of messages.
\r
82 -If the remove switch is given, tags will be removed instead of
\r
84 - (goto-char (point-min))
\r
85 - (let ((op (if remove "-" "+")))
\r
86 - (loop do (notmuch-show-tag-message (concat op tag))
\r
87 - until (not (notmuch-show-goto-message-next)))))
\r
89 -(defun notmuch-show-add-tag-thread (tag)
\r
90 - "Add tag to all messages in the current thread."
\r
92 - (notmuch-show-tag-thread-internal tag))
\r
94 -(defun notmuch-show-remove-tag-thread (tag)
\r
95 - "Remove tag from all messages in the current thread."
\r
97 - (notmuch-show-tag-thread-internal tag t))
\r
99 (defun notmuch-show-next-thread (&optional show-next)
\r
100 "Move to the next item in the search results, if any."
\r
102 @@ -1645,9 +1625,8 @@ being delivered to the same thread. It does not archive the
\r
103 entire thread, but only the messages shown in the current
\r
107 - (notmuch-show-add-tag-thread "inbox")
\r
108 - (notmuch-show-remove-tag-thread "inbox")))
\r
109 + (let ((op (if unarchive "+" "-")))
\r
110 + (notmuch-show-tag-all (concat op "inbox"))))
\r
112 (defun notmuch-show-archive-thread-then-next ()
\r
113 "Archive each message in thread, then show next thread from search."
\r