mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-23 01:44:52 +01:00
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.
This commit is contained in:
parent
26fce4ae60
commit
9d8fa2acac
1 changed files with 5 additions and 5 deletions
|
@ -548,15 +548,15 @@ messages instead of running (notmuch-call-notmuch-process \"tag\" ..)
|
||||||
directly, so that hooks specified in notmuch-before-tag-hook and
|
directly, so that hooks specified in notmuch-before-tag-hook and
|
||||||
notmuch-after-tag-hook will be run."
|
notmuch-after-tag-hook will be run."
|
||||||
;; Perform some validation
|
;; Perform some validation
|
||||||
(when (null tags) (error "No tags given"))
|
|
||||||
(mapc (lambda (tag)
|
(mapc (lambda (tag)
|
||||||
(unless (string-match-p "^[-+]\\S-+$" tag)
|
(unless (string-match-p "^[-+]\\S-+$" tag)
|
||||||
(error "Tag must be of the form `+this_tag' or `-that_tag'")))
|
(error "Tag must be of the form `+this_tag' or `-that_tag'")))
|
||||||
tags)
|
tags)
|
||||||
|
(unless (null tags)
|
||||||
(run-hooks 'notmuch-before-tag-hook)
|
(run-hooks 'notmuch-before-tag-hook)
|
||||||
(apply 'notmuch-call-notmuch-process
|
(apply 'notmuch-call-notmuch-process "tag"
|
||||||
(append (list "tag") tags (list "--" query)))
|
(append tags (list "--" query)))
|
||||||
(run-hooks 'notmuch-after-tag-hook))
|
(run-hooks 'notmuch-after-tag-hook)))
|
||||||
|
|
||||||
(defcustom notmuch-before-tag-hook nil
|
(defcustom notmuch-before-tag-hook nil
|
||||||
"Hooks that are run before tags of a message are modified.
|
"Hooks that are run before tags of a message are modified.
|
||||||
|
|
Loading…
Reference in a new issue