[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 2bfb04e 220/350: Move ebdb-message-search to ebdb.
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 2bfb04e 220/350: Move ebdb-message-search to ebdb.el |
Date: |
Mon, 14 Aug 2017 11:46:41 -0400 (EDT) |
branch: externals/ebdb
commit 2bfb04efe0bed15cb59494c80e9a96fa6c286cdb
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Move ebdb-message-search to ebdb.el
* ebdb-com.el: It shouldn't be in here.
* ebdb.el: Move it here.
---
ebdb-com.el | 29 -----------------------------
ebdb.el | 29 +++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 3b6041b..20d9515 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -1501,35 +1501,6 @@ DATE must be in yyyy-mm-dd format."
"Used for parsing phone numbers."
(string-to-number (match-string num string)))
-(defun ebdb-message-search (name mail)
- "Return list of EBDB records matching NAME and/or MAIL.
-First try to find a record matching both NAME and MAIL.
-If this fails try to find a record matching MAIL.
-If this fails try to find a record matching NAME.
-NAME may match FIRST_LAST, LAST_FIRST or AKA.
-
-This function performs a fast search using `ebdb-hashtable'.
-NAME and MAIL must be strings or nil.
-See `ebdb-search' for searching records with regexps."
- (when (or name mail)
- (unless ebdb-db-list
- (ebdb-load))
- (let ((mrecords (if mail (ebdb-gethash mail '(mail))))
- (nrecords (if name (ebdb-gethash name '(fl-name lf-name aka)))))
- ;; (1) records matching NAME and MAIL
- (or (and mrecords nrecords
- (let (records)
- (dolist (record nrecords)
- (mapc (lambda (mr) (if (and (eq record mr)
- (not (memq record records)))
- (push record records)))
- mrecords))
- records))
- ;; (2) records matching MAIL
- mrecords
- ;; (3) records matching NAME
- nrecords))))
-
(defmacro ebdb-with-record-edits (spec &rest body)
"Run BODY on all records listed in the cdr of SPEC.
diff --git a/ebdb.el b/ebdb.el
index 0a309d3..4b34d0e 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -4756,6 +4756,35 @@ With prefix ARG, insert string at point."
;;; Searching EBDB
+(defun ebdb-message-search (name mail)
+ "Return list of EBDB records matching NAME and/or MAIL.
+First try to find a record matching both NAME and MAIL.
+If this fails try to find a record matching MAIL.
+If this fails try to find a record matching NAME.
+NAME may match FIRST_LAST, LAST_FIRST or AKA.
+
+This function performs a fast search using `ebdb-hashtable'.
+NAME and MAIL must be strings or nil.
+See `ebdb-search' for searching records with regexps."
+ (when (or name mail)
+ (unless ebdb-db-list
+ (ebdb-load))
+ (let ((mrecords (if mail (ebdb-gethash mail '(mail))))
+ (nrecords (if name (ebdb-gethash name '(fl-name lf-name aka)))))
+ ;; (1) records matching NAME and MAIL
+ (or (and mrecords nrecords
+ (let (records)
+ (dolist (record nrecords)
+ (mapc (lambda (mr) (if (and (eq record mr)
+ (not (memq record records)))
+ (push record records)))
+ mrecords))
+ records))
+ ;; (2) records matching MAIL
+ mrecords
+ ;; (3) records matching NAME
+ nrecords))))
+
(defun ebdb-search (records clauses &optional invert)
"Search RECORDS for records matching CLAUSES.
- [elpa] externals/ebdb c07babf 203/350: If alt-names search fails, fall back on actual name field search, (continued)
- [elpa] externals/ebdb c07babf 203/350: If alt-names search fails, fall back on actual name field search, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 501edfb 149/350: Give Org mode its own popup window, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 0612d92 153/350: Comment out ebdb-mua-auto-snarf-signature, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 957fc1b 157/350: Implement popping of buffer search history, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 3cb827e 181/350: Check for existence of fiel-attribute-modification-time, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb aabe2c0 189/350: Stupid mistake in previous commit, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6549647 198/350: More tests, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f316417 202/350: Change keybinding for ebdb-prev-field, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bfc5d9d 208/350: Internationalized ebdb-parse method for names must accept slots arg, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 0c2056c 209/350: Basic tests for EBDB's internationalization support, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 2bfb04e 220/350: Move ebdb-message-search to ebdb.el,
Eric Abrahamsen <=
- [elpa] externals/ebdb 40d71b9 222/350: Steal UUID generating function from Org, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4937cbd 225/350: Specify class of name fields when updating from MUA, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 13c0a38 216/350: Tweaks to testing macros, more tests, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 2b28f57 239/350: Bump to version 0.2, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ff3cfa4 232/350: ebdb-parse-i18n for Chinese phones should pass class arg through, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d5bec83 229/350: Fix to UUID change, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 72aba6a 228/350: New label/field alist for vcard export, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d0d0bbb 233/350: Shift transformation of search strings into ebdb-search, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dc4217d 213/350: Compiler-inspired fixes, volume 5453, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ce5d9ee 242/350: Fix vCard formatting for anniversaries, Eric Abrahamsen, 2017/08/14