diff options
| author | Glenn Morris | 2013-05-06 00:14:03 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-05-06 00:14:03 -0700 |
| commit | ddf9925e265791840feafd7093ae3947fe68ebb3 (patch) | |
| tree | c58dff3b69e200a6b92eb6101e636604b7e89dae | |
| parent | a8899b6b3a2a0c3b336f6b793f0032b64348eef4 (diff) | |
| download | emacs-ddf9925e265791840feafd7093ae3947fe68ebb3.tar.gz emacs-ddf9925e265791840feafd7093ae3947fe68ebb3.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/net/eudc-export.el | 16 |
2 files changed, 18 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 18364654539..f688e192acc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2013-05-06 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * net/eudc-export.el: Make it loadable without bbdb. | ||
| 4 | (top-level): Use require rather than load-library. | ||
| 5 | (eudc-create-bbdb-record, eudc-bbdbify-phone) | ||
| 6 | (eudc-batch-export-records-to-bbdb) | ||
| 7 | (eudc-insert-record-at-point-into-bbdb, eudc-try-bbdb-insert): | ||
| 8 | Require bbdb. | ||
| 9 | |||
| 1 | 2013-05-06 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2013-05-06 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 11 | ||
| 3 | * progmodes/octave.el (octave-texinfo-font-lock-keywords): Remove. | 12 | * progmodes/octave.el (octave-texinfo-font-lock-keywords): Remove. |
diff --git a/lisp/net/eudc-export.el b/lisp/net/eudc-export.el index b43a8c631e3..8e52a4df4ed 100644 --- a/lisp/net/eudc-export.el +++ b/lisp/net/eudc-export.el | |||
| @@ -31,16 +31,16 @@ | |||
| 31 | 31 | ||
| 32 | (require 'eudc) | 32 | (require 'eudc) |
| 33 | 33 | ||
| 34 | (if (not (featurep 'bbdb)) | 34 | ;; NOERROR is so we can compile it. |
| 35 | (load-library "bbdb")) | 35 | (require 'bbdb nil t) |
| 36 | (if (not (featurep 'bbdb-com)) | 36 | (require 'bbdb-com nil t) |
| 37 | (load-library "bbdb-com")) | ||
| 38 | 37 | ||
| 39 | (defun eudc-create-bbdb-record (record &optional silent) | 38 | (defun eudc-create-bbdb-record (record &optional silent) |
| 40 | "Create a BBDB record using the RECORD alist. | 39 | "Create a BBDB record using the RECORD alist. |
| 41 | RECORD is an alist of (KEY . VALUE) where KEY is a directory attribute name | 40 | RECORD is an alist of (KEY . VALUE) where KEY is a directory attribute name |
| 42 | symbol and VALUE is the corresponding value for the record. | 41 | symbol and VALUE is the corresponding value for the record. |
| 43 | If SILENT is non-nil then the created BBDB record is not displayed." | 42 | If SILENT is non-nil then the created BBDB record is not displayed." |
| 43 | (require 'bbdb) | ||
| 44 | ;; This function runs in a special context where lisp symbols corresponding | 44 | ;; This function runs in a special context where lisp symbols corresponding |
| 45 | ;; to field names in record are bound to the corresponding values | 45 | ;; to field names in record are bound to the corresponding values |
| 46 | (eval | 46 | (eval |
| @@ -166,6 +166,7 @@ LOCATION is used as the address location for bbdb." | |||
| 166 | PHONE is either a string supposedly containing a phone number or | 166 | PHONE is either a string supposedly containing a phone number or |
| 167 | a list of such strings which are concatenated. | 167 | a list of such strings which are concatenated. |
| 168 | LOCATION is used as the phone location for BBDB." | 168 | LOCATION is used as the phone location for BBDB." |
| 169 | (require 'bbdb) | ||
| 169 | (cond | 170 | (cond |
| 170 | ((stringp phone) | 171 | ((stringp phone) |
| 171 | (let (phone-list) | 172 | (let (phone-list) |
| @@ -188,6 +189,7 @@ LOCATION is used as the phone location for BBDB." | |||
| 188 | (defun eudc-batch-export-records-to-bbdb () | 189 | (defun eudc-batch-export-records-to-bbdb () |
| 189 | "Insert all the records returned by a directory query into BBDB." | 190 | "Insert all the records returned by a directory query into BBDB." |
| 190 | (interactive) | 191 | (interactive) |
| 192 | (require 'bbdb) | ||
| 191 | (goto-char (point-min)) | 193 | (goto-char (point-min)) |
| 192 | (let ((nbrec 0) | 194 | (let ((nbrec 0) |
| 193 | record) | 195 | record) |
| @@ -203,6 +205,7 @@ LOCATION is used as the phone location for BBDB." | |||
| 203 | "Insert record at point into the BBDB database. | 205 | "Insert record at point into the BBDB database. |
| 204 | This function can only be called from a directory query result buffer." | 206 | This function can only be called from a directory query result buffer." |
| 205 | (interactive) | 207 | (interactive) |
| 208 | (require 'bbdb) | ||
| 206 | (let ((record (and (overlays-at (point)) | 209 | (let ((record (and (overlays-at (point)) |
| 207 | (overlay-get (car (overlays-at (point))) 'eudc-record)))) | 210 | (overlay-get (car (overlays-at (point))) 'eudc-record)))) |
| 208 | (if (null record) | 211 | (if (null record) |
| @@ -213,9 +216,8 @@ This function can only be called from a directory query result buffer." | |||
| 213 | (defun eudc-try-bbdb-insert () | 216 | (defun eudc-try-bbdb-insert () |
| 214 | "Call `eudc-insert-record-at-point-into-bbdb' if on a record." | 217 | "Call `eudc-insert-record-at-point-into-bbdb' if on a record." |
| 215 | (interactive) | 218 | (interactive) |
| 216 | (and (or (featurep 'bbdb) | 219 | (require 'bbdb) |
| 217 | (prog1 (locate-library "bbdb") (message ""))) | 220 | (and (overlays-at (point)) |
| 218 | (overlays-at (point)) | ||
| 219 | (overlay-get (car (overlays-at (point))) 'eudc-record) | 221 | (overlay-get (car (overlays-at (point))) 'eudc-record) |
| 220 | (eudc-insert-record-at-point-into-bbdb))) | 222 | (eudc-insert-record-at-point-into-bbdb))) |
| 221 | 223 | ||