]> code.delx.au - gnu-emacs/blobdiff - lisp/net/eudcb-bbdb.el
Update copyright year to 2015
[gnu-emacs] / lisp / net / eudcb-bbdb.el
index 9f6dba703b1d4488db9b4997013e4c6d2a6a9be4..0400e5b5bb41696363651bd15a128c3690239f52 100644 (file)
@@ -1,6 +1,6 @@
 ;;; eudcb-bbdb.el --- Emacs Unified Directory Client - BBDB Backend -*- coding: utf-8 -*-
 
-;; Copyright (C) 1998-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2015 Free Software Foundation, Inc.
 
 ;; Author: Oscar Figueiredo <oscar@cpe.fr>
 ;; Maintainer: Pavel Janík <Pavel@Janik.cz>
 ;;; Code:
 
 (require 'eudc)
-(if (not (featurep 'bbdb))
-    (load-library "bbdb"))
-(if (not (featurep 'bbdb-com))
-    (load-library "bbdb-com"))
+
+;; Make it loadable on systems without bbdb.
+(require 'bbdb nil t)
+(require 'bbdb-com nil t)
 
 ;;{{{      Internal cooking
 
@@ -71,6 +71,7 @@
 
 (defun eudc-bbdb-filter-non-matching-record (record)
   "Return RECORD if it matches `eudc-bbdb-current-query', nil otherwise."
+  (require 'bbdb)
   (catch 'unmatch
     (progn
       (dolist (condition eudc-bbdb-current-query)
                   (&optional dont-check-disk already-in-db-buffer))
 
 (defun eudc-bbdb-extract-phones (record)
+  (require 'bbdb)
   (mapcar (function
           (lambda (phone)
             (if eudc-bbdb-use-locations-as-attribute-names
          (bbdb-record-phones record)))
 
 (defun eudc-bbdb-extract-addresses (record)
+  (require 'bbdb)
   (let (s c val)
     (mapcar (lambda (address)
               (setq c (bbdb-address-streets address))
 (defun eudc-bbdb-format-record-as-result (record)
   "Format the BBDB RECORD as a EUDC query result record.
 The record is filtered according to `eudc-bbdb-current-return-attributes'"
+  (require 'bbdb)
   (let ((attrs (or eudc-bbdb-current-return-attributes
                   '(firstname lastname aka company phones addresses net notes)))
        attr
@@ -188,7 +192,7 @@ QUERY is a list of cons cells (ATTR . VALUE) where ATTRs should be valid
 BBDB attribute names.
 RETURN-ATTRS is a list of attributes to return, defaulting to
 `eudc-default-return-attributes'."
-
+  (require 'bbdb)
   (let ((eudc-bbdb-current-query query)
        (eudc-bbdb-current-return-attributes return-attrs)
        (query-attrs (eudc-bbdb-format-query query))