aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Dmitry Kurochkin <dmitry.kurochkin@gmail.com>2012-02-05 11:13:51 +0400
committerGravatar David Bremner <bremner@debian.org>2012-02-08 11:21:52 -0400
commit9d8fa2acac9185a5c62fad1db49a1f5920143f9d (patch)
treeb94467e2c1e43e1b590d9b539568051d095e0b11 /emacs
parent26fce4ae605d6315bd2732ba3607ac30138e67b4 (diff)
emacs: accept empty tag list in `notmuch-tag'
Since `notmuch-tag' is a non-interactive function and hence is meant to be invoked programmatically, it should accept zero tags. Also, the tagging operations (bound to "*", "+", "-") would accept empty input without an error.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index b06d8a11..0ffdf9cb 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -548,15 +548,15 @@ messages instead of running (notmuch-call-notmuch-process \"tag\" ..)
directly, so that hooks specified in notmuch-before-tag-hook and
notmuch-after-tag-hook will be run."
;; Perform some validation
- (when (null tags) (error "No tags given"))
(mapc (lambda (tag)
(unless (string-match-p "^[-+]\\S-+$" tag)
(error "Tag must be of the form `+this_tag' or `-that_tag'")))
tags)
- (run-hooks 'notmuch-before-tag-hook)
- (apply 'notmuch-call-notmuch-process
- (append (list "tag") tags (list "--" query)))
- (run-hooks 'notmuch-after-tag-hook))
+ (unless (null tags)
+ (run-hooks 'notmuch-before-tag-hook)
+ (apply 'notmuch-call-notmuch-process "tag"
+ (append tags (list "--" query)))
+ (run-hooks 'notmuch-after-tag-hook)))
(defcustom notmuch-before-tag-hook nil
"Hooks that are run before tags of a message are modified.