emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb 767a9fa 07/21: Allow two kinds of searches on tags


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 767a9fa 07/21: Allow two kinds of searches on tags
Date: Sun, 17 Sep 2017 15:32:46 -0400 (EDT)

branch: externals/ebdb
commit 767a9fa6f512af12861112f5fcc1b2dfc187d50c
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]