emacs-elpa-diffs
[Top][All Lists]
Advanced

[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'



reply via email to

[Prev in Thread] Current Thread [Next in Thread]