Commit ddf9925e authored by Glenn Morris's avatar Glenn Morris
Browse files

* net/eudc-export.el: Make it loadable without bbdb.

(top-level): Use require rather than load-library.
(eudc-create-bbdb-record, eudc-bbdbify-phone)
(eudc-batch-export-records-to-bbdb)
(eudc-insert-record-at-point-into-bbdb, eudc-try-bbdb-insert):
Require bbdb.
parent a8899b6b
2013-05-06 Glenn Morris <rgm@gnu.org>
* net/eudc-export.el: Make it loadable without bbdb.
(top-level): Use require rather than load-library.
(eudc-create-bbdb-record, eudc-bbdbify-phone)
(eudc-batch-export-records-to-bbdb)
(eudc-insert-record-at-point-into-bbdb, eudc-try-bbdb-insert):
Require bbdb.
2013-05-06 Stefan Monnier <monnier@iro.umontreal.ca> 2013-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
   
* progmodes/octave.el (octave-texinfo-font-lock-keywords): Remove. * progmodes/octave.el (octave-texinfo-font-lock-keywords): Remove.
......
...@@ -31,16 +31,16 @@ ...@@ -31,16 +31,16 @@
(require 'eudc) (require 'eudc)
(if (not (featurep 'bbdb)) ;; NOERROR is so we can compile it.
(load-library "bbdb")) (require 'bbdb nil t)
(if (not (featurep 'bbdb-com)) (require 'bbdb-com nil t)
(load-library "bbdb-com"))
(defun eudc-create-bbdb-record (record &optional silent) (defun eudc-create-bbdb-record (record &optional silent)
"Create a BBDB record using the RECORD alist. "Create a BBDB record using the RECORD alist.
RECORD is an alist of (KEY . VALUE) where KEY is a directory attribute name RECORD is an alist of (KEY . VALUE) where KEY is a directory attribute name
symbol and VALUE is the corresponding value for the record. symbol and VALUE is the corresponding value for the record.
If SILENT is non-nil then the created BBDB record is not displayed." If SILENT is non-nil then the created BBDB record is not displayed."
(require 'bbdb)
;; This function runs in a special context where lisp symbols corresponding ;; This function runs in a special context where lisp symbols corresponding
;; to field names in record are bound to the corresponding values ;; to field names in record are bound to the corresponding values
(eval (eval
...@@ -166,6 +166,7 @@ LOCATION is used as the address location for bbdb." ...@@ -166,6 +166,7 @@ LOCATION is used as the address location for bbdb."
PHONE is either a string supposedly containing a phone number or PHONE is either a string supposedly containing a phone number or
a list of such strings which are concatenated. a list of such strings which are concatenated.
LOCATION is used as the phone location for BBDB." LOCATION is used as the phone location for BBDB."
(require 'bbdb)
(cond (cond
((stringp phone) ((stringp phone)
(let (phone-list) (let (phone-list)
...@@ -188,6 +189,7 @@ LOCATION is used as the phone location for BBDB." ...@@ -188,6 +189,7 @@ LOCATION is used as the phone location for BBDB."
(defun eudc-batch-export-records-to-bbdb () (defun eudc-batch-export-records-to-bbdb ()
"Insert all the records returned by a directory query into BBDB." "Insert all the records returned by a directory query into BBDB."
(interactive) (interactive)
(require 'bbdb)
(goto-char (point-min)) (goto-char (point-min))
(let ((nbrec 0) (let ((nbrec 0)
record) record)
...@@ -203,6 +205,7 @@ LOCATION is used as the phone location for BBDB." ...@@ -203,6 +205,7 @@ LOCATION is used as the phone location for BBDB."
"Insert record at point into the BBDB database. "Insert record at point into the BBDB database.
This function can only be called from a directory query result buffer." This function can only be called from a directory query result buffer."
(interactive) (interactive)
(require 'bbdb)
(let ((record (and (overlays-at (point)) (let ((record (and (overlays-at (point))
(overlay-get (car (overlays-at (point))) 'eudc-record)))) (overlay-get (car (overlays-at (point))) 'eudc-record))))
(if (null record) (if (null record)
...@@ -213,9 +216,8 @@ This function can only be called from a directory query result buffer." ...@@ -213,9 +216,8 @@ This function can only be called from a directory query result buffer."
(defun eudc-try-bbdb-insert () (defun eudc-try-bbdb-insert ()
"Call `eudc-insert-record-at-point-into-bbdb' if on a record." "Call `eudc-insert-record-at-point-into-bbdb' if on a record."
(interactive) (interactive)
(and (or (featurep 'bbdb) (require 'bbdb)
(prog1 (locate-library "bbdb") (message ""))) (and (overlays-at (point))
(overlays-at (point))
(overlay-get (car (overlays-at (point))) 'eudc-record) (overlay-get (car (overlays-at (point))) 'eudc-record)
(eudc-insert-record-at-point-into-bbdb))) (eudc-insert-record-at-point-into-bbdb)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment