branch: externals/ebdb
commit 767a9fa6f512af12861112f5fcc1b2dfc187d50c
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Allow two kinds of searches on tags
* ebdb.el (ebdb-search-read): If there's a [-+|&] in the search
string, use an org tag matcher, otherwise it's just a single tag,
return that tag.
---
ebdb.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 920ca5c..bc1ad78 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2320,11 +2320,13 @@ See `ebdb-url-valid-schemes' for a list of acceptable
schemes."
(ebdb-concat 'ebdb-field-tags (slot-value field 'tags)))
(cl-defmethod ebdb-search-read ((_class (subclass ebdb-field-tags)))
- (cdr
- ;; Thank you Org!
- (org-make-tags-matcher
- (ebdb-read-string
- "Search for tags (eg +tag1-tag2|tag3): "))))
+ (let ((search-string (ebdb-read-string
+ "Search for tags (eg +tag1-tag2|tag3): ")))
+ (if (string-match-p "[-+|&]" search-string)
+ (cdr
+ ;; Thank you Org!
+ (org-make-tags-matcher search-string))
+ search-string)))
(cl-defmethod ebdb-field-search ((field ebdb-field-tags)
func)