branch: externals/ebdb
commit 134e4fa2c8fa6c0128ebacd45dae4bb0ebea2134
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Add an ebdb-record-search method for organization domains
* ebdb.el (ebdb-record-search): Useful for role-based stuff.
---
ebdb.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/ebdb.el b/ebdb.el
index 7669b3d..2c87c61 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -5834,6 +5834,13 @@ values, by default the search is not handed to the name
field itself."
(when (ebdb-field-search m regexp)
(throw 'found t))))))))
+(cl-defmethod ebdb-record-search ((org ebdb-record-organization)
+ (_type (subclass ebdb-field-domain))
+ (criterion string))
+ (let ((dom (slot-value org 'domain)))
+ (and dom
+ (string-match-p criterion (ebdb-string dom)))))
+
(cl-defmethod ebdb-record-search ((record ebdb-record-person)
(_type (eql organization))
(regexp string))