]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-tag.el
Fix documentation for notmuch--tag-hook functions
[notmuch] / emacs / notmuch-tag.el
index 07c260ebbd07e13e23ce6524d1a5fdc9368ca481..c7f62c90974995caf64aea212e0a5eae9fa97b5e 100644 (file)
@@ -265,7 +265,7 @@ changed (the normal case) are shown using formats from
 (defcustom notmuch-before-tag-hook nil
   "Hooks that are run before tags of a message are modified.
 
-'tags' will contain the tags that are about to be added or removed as
+'tag-changes' will contain the tags that are about to be added or removed as
 a list of strings of the form \"+TAG\" or \"-TAG\".
 'query' will be a string containing the search query that determines
 the messages that are about to be tagged"
@@ -277,7 +277,7 @@ the messages that are about to be tagged"
 (defcustom notmuch-after-tag-hook nil
   "Hooks that are run after tags of a message are modified.
 
-'tags' will contain the tags that were added or removed as
+'tag-changes' will contain the tags that were added or removed as
 a list of strings of the form \"+TAG\" or \"-TAG\".
 'query' will be a string containing the search query that determines
 the messages that were tagged"
@@ -387,6 +387,8 @@ notmuch-after-tag-hook will be run."
          (unless (string-match-p "^[-+]\\S-+$" tag-change)
            (error "Tag must be of the form `+this_tag' or `-that_tag'")))
        tag-changes)
+  (unless query
+    (error "Nothing to tag!"))
   (unless (null tag-changes)
     (run-hooks 'notmuch-before-tag-hook)
     (if (<= (length query) notmuch-tag-argument-limit)