[PATCH v2 05/14] cli/reply: reorganize create_reply_message()
[notmuch-archives.git] / db / bf56e113ea3042e0d2843f1f1f6c57178022fc
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 826D4421166\r
6         for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 21:36:09 -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 0UWuFoCM+j-l for <notmuch@notmuchmail.org>;\r
17         Sun, 29 Jan 2012 21:36:07 -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 AF7EA42119E\r
22         for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 21:35:35 -0800 (PST)\r
23 Received: by mail-bk0-f53.google.com with SMTP id 11so1052482bke.26\r
24         for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 21:35:35 -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=mILkKF1tAooB48ry02tQnQfXPSoYzQo3tnTNoh2I3OU=;\r
28         b=obCDJWug72RxsBXMYxoGmGpNzdUe/xoEW6lce00pdMlnIBCIGmYQTYodroiAk06zG3\r
29         3x/3s4ZoW5iZbPoay3cefD4q3dKKCEdh5SYGz2GoK3g3Oe4fYIQbXXdQI0bEqvBpMjB5\r
30         Uv2aHFm2qzjOlYTYZJERNuu7BAoLJZtkByNms=\r
31 Received: by 10.204.152.15 with SMTP id e15mr7969088bkw.108.1327901735462;\r
32         Sun, 29 Jan 2012 21:35:35 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id ek9sm35151326bkb.10.2012.01.29.21.35.34\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Sun, 29 Jan 2012 21:35:34 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v3 10/12] emacs: accept empty tag list in `notmuch-tag'\r
40 Date: Mon, 30 Jan 2012 09:34:02 +0400\r
41 Message-Id: <1327901644-15799-11-git-send-email-dmitry.kurochkin@gmail.com>\r
42 X-Mailer: git-send-email 1.7.8.3\r
43 In-Reply-To: <1327901644-15799-1-git-send-email-dmitry.kurochkin@gmail.com>\r
44 References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45         <1327901644-15799-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: Mon, 30 Jan 2012 05:36:10 -0000\r
59 \r
60 Since `notmuch-tag' is a non-interactive function and hence is meant\r
61 to be invoked programmatically, it should accept zero tags.  Also, the\r
62 tagging operations (bound to "*", "+", "-") would accept empty input\r
63 without an error.\r
64 ---\r
65  emacs/notmuch.el |   10 +++++-----\r
66  1 files changed, 5 insertions(+), 5 deletions(-)\r
67 \r
68 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
69 index 2332c42..c464c3c 100644\r
70 --- a/emacs/notmuch.el\r
71 +++ b/emacs/notmuch.el\r
72 @@ -554,15 +554,15 @@ messages instead of running (notmuch-call-notmuch-process \"tag\" ..)\r
73  directly, so that hooks specified in notmuch-before-tag-hook and\r
74  notmuch-after-tag-hook will be run."\r
75    ;; Perform some validation\r
76 -  (when (null tags) (error "No tags given"))\r
77    (mapc (lambda (tag)\r
78           (unless (string-match-p "^[-+]\\S-+$" tag)\r
79             (error "Tag must be of the form `+this_tag' or `-that_tag'")))\r
80         tags)\r
81 -  (run-hooks 'notmuch-before-tag-hook)\r
82 -  (apply 'notmuch-call-notmuch-process\r
83 -        (append (list "tag") tags (list "--" query)))\r
84 -  (run-hooks 'notmuch-after-tag-hook))\r
85 +  (unless (null tags)\r
86 +    (run-hooks 'notmuch-before-tag-hook)\r
87 +    (apply 'notmuch-call-notmuch-process "tag"\r
88 +          (append tags (list "--" query)))\r
89 +    (run-hooks 'notmuch-after-tag-hook)))\r
90  \r
91  (defcustom notmuch-before-tag-hook nil\r
92    "Hooks that are run before tags of a message are modified.\r
93 -- \r
94 1.7.8.3\r
95 \r