[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb e8c956d 1/9: Adjust database checks when loading
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb e8c956d 1/9: Adjust database checks when loading |
Date: |
Wed, 18 Oct 2017 17:51:56 -0400 (EDT) |
branch: externals/ebdb
commit e8c956df3c9285952988839e4a01b0a6d346714d
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Adjust database checks when loading
* ebdb.el (ebdb-load): Checks were previously both incomplete and
redundant. By the time the first loop over ebdb-sources is complete,
we should be completely confident that the database is of the
correct class.
---
ebdb.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 22ce715..60b2b3c 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -4848,18 +4848,17 @@ important work is done by the `ebdb-db-load' method."
(setq s (make-instance 'ebdb-db-file :file s :dirty t))
;; Try to get it on disk first.
(ebdb-db-save s))))
- ((null (object-of-class-p s 'ebdb-db))
+ ((null (and (object-p s)
+ (object-of-class-p s 'ebdb-db)))
(error "Source %s must be a filename or instance of `ebdb-db'."
s)))
;; Now load it.
- (if (object-of-class-p s 'ebdb-db)
- (if (null (slot-value s 'disabled))
- (ebdb-db-load s)
- (message "%s is currently disabled." (ebdb-string s))
- ;; Remove this database's records from
- ;; `ebdb-record-tracker'.
- (mapcar #'delete-instance (slot-value s 'records))
- (sit-for 2))
- (error "Object %s is not a EBDB database" s)))
+ (if (null (slot-value s 'disabled))
+ (ebdb-db-load s)
+ (message "%s is currently disabled." (ebdb-string s))
+ ;; Remove this database's records from
+ ;; `ebdb-record-tracker'.
+ (mapcar #'delete-instance (slot-value s 'records))
+ (sit-for 2)))
(if (and
(null ebdb-record-tracker)
(or (and (bound-and-true-p bbdb-file)
@@ -4870,7 +4869,7 @@ important work is done by the `ebdb-db-load' method."
(message "Initializing EBDB records...")
(if (fboundp 'make-thread)
(let ((thread (make-thread #'ebdb-initialize-threadwise)))
- (thread-join thread))
+ (thread-join thread))
(ebdb-initialize))
(message "Initializing EBDB records... done")
;; Users will expect the same ordering as `ebdb-sources'
- [elpa] externals/ebdb updated (b0029d3 -> aac31a3), Eric Abrahamsen, 2017/10/18
- [elpa] externals/ebdb e8c956d 1/9: Adjust database checks when loading,
Eric Abrahamsen <=
- [elpa] externals/ebdb 64dbf86 5/9: Bah, commited a bit of (erroneous) test code, Eric Abrahamsen, 2017/10/18
- [elpa] externals/ebdb 94b11b9 2/9: Various tweaks, Eric Abrahamsen, 2017/10/18
- [elpa] externals/ebdb c6aef3b 3/9: Fix parsing of address countries during migration, Eric Abrahamsen, 2017/10/18
- [elpa] externals/ebdb 9acc6d4 4/9: Provide more control over faces in *EBDB* buffers, Eric Abrahamsen, 2017/10/18
- [elpa] externals/ebdb dcb1fcc 6/9: Turns out ebdb-fmt-collect-fields could have been a lot simpler, Eric Abrahamsen, 2017/10/18
- [elpa] externals/ebdb 864c1f3 7/9: Give formatters a post-format-function slot, Eric Abrahamsen, 2017/10/18
- [elpa] externals/ebdb aac31a3 9/9: Add browse-url action for domain fields, Eric Abrahamsen, 2017/10/18
- [elpa] externals/ebdb 1ebd9eb 8/9: Fix function call, Eric Abrahamsen, 2017/10/18