]> code.delx.au - gnu-emacs/blobdiff - lisp/net/eudc.el
* lisp/net/tramp-sh.el (tramp-methods) <doas>: Add. (Bug#22542)
[gnu-emacs] / lisp / net / eudc.el
index ada9eae813ecf98b438f88b95cf973bd20a72801..867bea98e771101f478a948879af93332dd9ceca 100644 (file)
@@ -1,6 +1,6 @@
-;;; eudc.el --- Emacs Unified Directory Client -*- coding: utf-8 -*-
+;;; eudc.el --- Emacs Unified Directory Client
 
-;; Copyright (C) 1998-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2016 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;;         Pavel Janík <Pavel@Janik.cz>
@@ -47,6 +47,8 @@
 
 (require 'wid-edit)
 
+(eval-when-compile (require 'cl-lib))
+
 (eval-and-compile
   (if (not (fboundp 'make-overlay))
       (require 'overlay)))
 ;; attribute name
 (defvar eudc-protocol-has-default-query-attributes nil)
 
+(defvar bbdb-version)
+
+(defun eudc--using-bbdb-3-or-newer-p ()
+  "Return non-nil if BBDB version is 3 or greater."
+  (or
+   ;; MELPA versions of BBDB may have a bad package version, but
+   ;; they're all version 3 or later.
+   (equal bbdb-version "@PACKAGE_VERSION@")
+   ;; Development versions of BBDB can have the format "X.YZ devo".
+   ;; Split the string just in case.
+   (version<= "3" (car (split-string bbdb-version)))))
+
 (defun eudc-plist-member (plist prop)
   "Return t if PROP has a value specified in PLIST."
   (if (not (= 0 (% (length plist) 2)))
@@ -698,7 +712,7 @@ If ERROR is non-nil, report an error if there is none."
   (let ((result (eudc-query (list (cons 'name name)) '(email)))
        email)
     (if (null (cdr result))
-       (setq email (cdaar result))
+       (setq email (cl-cdaar result))
       (error "Multiple match--use the query form"))
     (if error
        (if email
@@ -716,7 +730,7 @@ If ERROR is non-nil, report an error if there is none."
   (let ((result (eudc-query (list (cons 'name name)) '(phone)))
        phone)
     (if (null (cdr result))
-       (setq phone (cdaar result))
+       (setq phone (cl-cdaar result))
       (error "Multiple match--use the query form"))
     (if error
        (if phone