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 41D29431FC3
\r
6 for <notmuch@notmuchmail.org>; Sat, 4 Feb 2012 23:15:48 -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 qywGvjbbv9MR for <notmuch@notmuchmail.org>;
\r
17 Sat, 4 Feb 2012 23:15:47 -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 B174B431FDA
\r
22 for <notmuch@notmuchmail.org>; Sat, 4 Feb 2012 23:15:37 -0800 (PST)
\r
23 Received: by mail-bk0-f53.google.com with SMTP id 11so4650313bke.26
\r
24 for <notmuch@notmuchmail.org>; Sat, 04 Feb 2012 23:15:37 -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=cc9HGiaBDJonFn8aJVMf+vFsQyM/q1awPQnQGbBlod0=;
\r
28 b=RuWH4pT6Q1zsszS0av9vKYGupjskNLPArF/woknjlRfqy5lW+WZkTlhHW+Wo9D3uOx
\r
29 gv+/1esQuvVnTNZ1zkUhyw5ndWvJXwCaQHPDczoHndxFtL8Bv+2i3GWmzQWuaXuX1JfA
\r
30 0ep1wNvv+tpSildC2QKkSu85z1jq0lhDN9x/g=
\r
31 Received: by 10.204.10.73 with SMTP id o9mr6134900bko.99.1328426137370;
\r
32 Sat, 04 Feb 2012 23:15:37 -0800 (PST)
\r
33 Received: from localhost ([91.144.186.21])
\r
34 by mx.google.com with ESMTPS id ez5sm32952883bkc.15.2012.02.04.23.15.36
\r
35 (version=TLSv1/SSLv3 cipher=OTHER);
\r
36 Sat, 04 Feb 2012 23:15:37 -0800 (PST)
\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH v5 10/12] emacs: accept empty tag list in `notmuch-tag'
\r
40 Date: Sun, 5 Feb 2012 11:13:51 +0400
\r
41 Message-Id: <1328426033-21480-11-git-send-email-dmitry.kurochkin@gmail.com>
\r
42 X-Mailer: git-send-email 1.7.9
\r
43 In-Reply-To: <1328426033-21480-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
44 References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
45 <1328426033-21480-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\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: Sun, 05 Feb 2012 07:15:49 -0000
\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
65 emacs/notmuch.el | 10 +++++-----
\r
66 1 files changed, 5 insertions(+), 5 deletions(-)
\r
68 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
69 index b06d8a1..0ffdf9c 100644
\r
70 --- a/emacs/notmuch.el
\r
71 +++ b/emacs/notmuch.el
\r
72 @@ -548,15 +548,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
78 (unless (string-match-p "^[-+]\\S-+$" tag)
\r
79 (error "Tag must be of the form `+this_tag' or `-that_tag'")))
\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
91 (defcustom notmuch-before-tag-hook nil
\r
92 "Hooks that are run before tags of a message are modified.
\r