aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar David Bremner <david@tethera.net>2014-05-28 09:50:32 -0300
committerGravatar David Bremner <david@tethera.net>2014-05-28 09:50:32 -0300
commit94064a6ba2f67005352915dc01c6eb0e19b761f9 (patch)
tree61f9fc6c78daafa39a93cdcd9336d246b240bd48 /emacs
parentec020894331b0ef9b594cdc47f4b79abeda4f9cd (diff)
parent90f9a5e65e8dab3fad0a60530d3ffc582f1b1a93 (diff)
Merge branch 'release'
A point release is slowly being built on branch release. Merge those changes into master.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-tag.el2
-rw-r--r--emacs/notmuch.el6
2 files changed, 6 insertions, 2 deletions
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 07c260eb..f54aa9d6 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -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)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 8aa01049..f6bf9c84 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -428,14 +428,16 @@ matched and unmatched messages in the current thread."
"Return the stable query for the current region.
If ONLY-MATCHED is non-nil, include only matched messages. If it
-is nil, include both matched and unmatched messages."
+is nil, include both matched and unmatched messages. If there are
+no messages in the region then return nil."
(let ((query-list nil) (all (not only-matched)))
(dolist (queries (notmuch-search-properties-in-region :query beg end))
(when (first queries)
(push (first queries) query-list))
(when (and all (second queries))
(push (second queries) query-list)))
- (concat "(" (mapconcat 'identity query-list ") or (") ")")))
+ (when query-list
+ (concat "(" (mapconcat 'identity query-list ") or (") ")"))))
(defun notmuch-search-find-authors ()
"Return the authors for the current thread"