Improve EUDC to BBDB 3 export
* eudc-vars.el (eudc-ldap-bbdb-conversion-alist): Change phone entry to single item. Add company conversion. * eudc-export.el (eudc-bbdbify-company): New function. (bbdb-parse-phone): Declare function. (eudc-bbdbify-phone): Add BBDB 3 support. (Bug#21971)
This commit is contained in:
parent
43d2e55fc1
commit
124f1807c4
2 changed files with 10 additions and 2 deletions
|
@ -167,8 +167,13 @@ LOCATION is used as the address location for bbdb."
|
|||
;; External.
|
||||
(declare-function bbdb-parse-phone-number "ext:bbdb-com"
|
||||
(string &optional number-type))
|
||||
(declare-function bbdb-parse-phone "ext:bbdb-com" (string &optional style))
|
||||
(declare-function bbdb-string-trim "ext:bbdb" (string))
|
||||
|
||||
(defun eudc-bbdbify-company (&rest organizations)
|
||||
"Return ORGANIZATIONS as a list compatible with BBDB."
|
||||
organizations)
|
||||
|
||||
(defun eudc-bbdbify-phone (phone location)
|
||||
"Parse PHONE into a vector compatible with BBDB.
|
||||
PHONE is either a string supposedly containing a phone number or
|
||||
|
@ -179,7 +184,9 @@ LOCATION is used as the phone location for BBDB."
|
|||
((stringp phone)
|
||||
(let (phone-list)
|
||||
(condition-case err
|
||||
(setq phone-list (bbdb-parse-phone-number phone))
|
||||
(setq phone-list (if (eudc--using-bbdb-3-or-newer-p)
|
||||
(bbdb-parse-phone phone)
|
||||
(bbdb-parse-phone-number phone)))
|
||||
(error
|
||||
(if (string= "phone number unparsable." (cadr err))
|
||||
(if (not (y-or-n-p (format "BBDB claims %S to be unparsable--insert anyway? " phone)))
|
||||
|
|
|
@ -369,7 +369,8 @@ BBDB fields. SPECs are sexps which are evaluated:
|
|||
'((name . cn)
|
||||
(net . mail)
|
||||
(address . (eudc-bbdbify-address postaladdress "Address"))
|
||||
(phone . ((eudc-bbdbify-phone telephonenumber "Phone"))))
|
||||
(phone . (eudc-bbdbify-phone telephonenumber "Phone"))
|
||||
(company . (eudc-bbdbify-company o)))
|
||||
"A mapping from BBDB to LDAP attributes.
|
||||
This is a list of cons cells (BBDB-FIELD . SPEC-OR-LIST) where
|
||||
BBDB-FIELD is the name of a field that must be defined in your BBDB
|
||||
|
|
Loading…
Add table
Reference in a new issue