diff options
| author | Glenn Morris | 2013-05-10 19:25:11 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-05-10 19:25:11 -0700 |
| commit | 445f95e2ab112f211dcd66b048628f383f9363dd (patch) | |
| tree | 44b6b2cc65719abed78fcc3d9b630ecc74044e80 /lisp/net | |
| parent | 99fb275649a4e1f1e022e9d1eb2881cab526934a (diff) | |
| download | emacs-445f95e2ab112f211dcd66b048628f383f9363dd.tar.gz emacs-445f95e2ab112f211dcd66b048628f383f9363dd.zip | |
Make a few libraries loadable in isolation
* lisp/calc/calc-menu.el: Make it loadable in isolation.
* lisp/gnus/gnus-vm.el: Make it loadable without VM.
(gnus-vm-make-folder, gnus-summary-save-in-vm): Require 'vm.
(vm-forward-message, vm-reply, vm-mail): Remove unused autoloads.
* lisp/net/eudcb-bbdb.el: Make it loadable without bbdb.
(eudc-bbdb-filter-non-matching-record, eudc-bbdb-extract-phones)
(eudc-bbdb-extract-addresses, eudc-bbdb-format-record-as-result)
(eudc-bbdb-query-internal): Require 'bbdb.
Diffstat (limited to 'lisp/net')
| -rw-r--r-- | lisp/net/eudcb-bbdb.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/net/eudcb-bbdb.el b/lisp/net/eudcb-bbdb.el index 9f6dba703b1..d9d2aa5fe85 100644 --- a/lisp/net/eudcb-bbdb.el +++ b/lisp/net/eudcb-bbdb.el | |||
| @@ -29,10 +29,10 @@ | |||
| 29 | ;;; Code: | 29 | ;;; Code: |
| 30 | 30 | ||
| 31 | (require 'eudc) | 31 | (require 'eudc) |
| 32 | (if (not (featurep 'bbdb)) | 32 | |
| 33 | (load-library "bbdb")) | 33 | ;; Make it loadable on systems without bbdb. |
| 34 | (if (not (featurep 'bbdb-com)) | 34 | (require 'bbdb nil t) |
| 35 | (load-library "bbdb-com")) | 35 | (require 'bbdb-com nil t) |
| 36 | 36 | ||
| 37 | ;;{{{ Internal cooking | 37 | ;;{{{ Internal cooking |
| 38 | 38 | ||
| @@ -71,6 +71,7 @@ | |||
| 71 | 71 | ||
| 72 | (defun eudc-bbdb-filter-non-matching-record (record) | 72 | (defun eudc-bbdb-filter-non-matching-record (record) |
| 73 | "Return RECORD if it matches `eudc-bbdb-current-query', nil otherwise." | 73 | "Return RECORD if it matches `eudc-bbdb-current-query', nil otherwise." |
| 74 | (require 'bbdb) | ||
| 74 | (catch 'unmatch | 75 | (catch 'unmatch |
| 75 | (progn | 76 | (progn |
| 76 | (dolist (condition eudc-bbdb-current-query) | 77 | (dolist (condition eudc-bbdb-current-query) |
| @@ -112,6 +113,7 @@ | |||
| 112 | (&optional dont-check-disk already-in-db-buffer)) | 113 | (&optional dont-check-disk already-in-db-buffer)) |
| 113 | 114 | ||
| 114 | (defun eudc-bbdb-extract-phones (record) | 115 | (defun eudc-bbdb-extract-phones (record) |
| 116 | (require 'bbdb) | ||
| 115 | (mapcar (function | 117 | (mapcar (function |
| 116 | (lambda (phone) | 118 | (lambda (phone) |
| 117 | (if eudc-bbdb-use-locations-as-attribute-names | 119 | (if eudc-bbdb-use-locations-as-attribute-names |
| @@ -123,6 +125,7 @@ | |||
| 123 | (bbdb-record-phones record))) | 125 | (bbdb-record-phones record))) |
| 124 | 126 | ||
| 125 | (defun eudc-bbdb-extract-addresses (record) | 127 | (defun eudc-bbdb-extract-addresses (record) |
| 128 | (require 'bbdb) | ||
| 126 | (let (s c val) | 129 | (let (s c val) |
| 127 | (mapcar (lambda (address) | 130 | (mapcar (lambda (address) |
| 128 | (setq c (bbdb-address-streets address)) | 131 | (setq c (bbdb-address-streets address)) |
| @@ -146,6 +149,7 @@ | |||
| 146 | (defun eudc-bbdb-format-record-as-result (record) | 149 | (defun eudc-bbdb-format-record-as-result (record) |
| 147 | "Format the BBDB RECORD as a EUDC query result record. | 150 | "Format the BBDB RECORD as a EUDC query result record. |
| 148 | The record is filtered according to `eudc-bbdb-current-return-attributes'" | 151 | The record is filtered according to `eudc-bbdb-current-return-attributes'" |
| 152 | (require 'bbdb) | ||
| 149 | (let ((attrs (or eudc-bbdb-current-return-attributes | 153 | (let ((attrs (or eudc-bbdb-current-return-attributes |
| 150 | '(firstname lastname aka company phones addresses net notes))) | 154 | '(firstname lastname aka company phones addresses net notes))) |
| 151 | attr | 155 | attr |
| @@ -188,7 +192,7 @@ QUERY is a list of cons cells (ATTR . VALUE) where ATTRs should be valid | |||
| 188 | BBDB attribute names. | 192 | BBDB attribute names. |
| 189 | RETURN-ATTRS is a list of attributes to return, defaulting to | 193 | RETURN-ATTRS is a list of attributes to return, defaulting to |
| 190 | `eudc-default-return-attributes'." | 194 | `eudc-default-return-attributes'." |
| 191 | 195 | (require 'bbdb) | |
| 192 | (let ((eudc-bbdb-current-query query) | 196 | (let ((eudc-bbdb-current-query query) |
| 193 | (eudc-bbdb-current-return-attributes return-attrs) | 197 | (eudc-bbdb-current-return-attributes return-attrs) |
| 194 | (query-attrs (eudc-bbdb-format-query query)) | 198 | (query-attrs (eudc-bbdb-format-query query)) |