[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 7d41fb9 076/350: Small tweaks to ebdb-load
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 7d41fb9 076/350: Small tweaks to ebdb-load |
Date: |
Mon, 14 Aug 2017 11:46:06 -0400 (EDT) |
branch: externals/ebdb
commit 7d41fb9226551b9c987b79705a75cc492c466cca
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Small tweaks to ebdb-load
* ebdb.el (ebdb-load): Accept actual ebdb-db instances in the
ebdb-sources list, and make some other small changes.
---
ebdb.el | 44 +++++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 64124c5..cceccb7 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -4357,25 +4357,26 @@ important work is done by the `ebdb-db-load' method."
(ebdb-clear-vars)
(run-hooks 'ebdb-before-load-hook)
(dolist (s sources)
- (if (stringp s)
- (if (file-exists-p s)
- ;; Handle auto-saved databases.
- (let ((auto-save-file (ebdb-db-make-auto-save-file-name s))
- (orig-filename s))
- (if (and (file-exists-p auto-save-file)
- (yes-or-no-p (format "Recover auto-save file for %s? "
s)))
- (progn (setq s (eieio-persistent-read auto-save-file
'ebdb-db t))
- (setf (slot-value s 'file) orig-filename)
- (setf (slot-value s 'dirty) t))
- (setq s (eieio-persistent-read s 'ebdb-db t))))
- ;; Handle new/nonexistent databases.
- (when (yes-or-no-p (format "%s does not exist, create? " s))
- (setq s (make-instance 'ebdb-db-file :file s :dirty t))
- ;; Try to get it on disk first.
- (ebdb-db-save s)))
- (error "Source %s should be a filename." s))
+ (cond ((stringp s)
+ (if (file-exists-p s)
+ ;; Handle auto-saved databases.
+ (let ((auto-save-file (ebdb-db-make-auto-save-file-name s))
+ (orig-filename s))
+ (if (and (file-exists-p auto-save-file)
+ (yes-or-no-p (format "Recover auto-save file for
%s? " s)))
+ (progn (setq s (eieio-persistent-read auto-save-file
'ebdb-db t))
+ (setf (slot-value s 'file) orig-filename)
+ (setf (slot-value s 'dirty) t))
+ (setq s (eieio-persistent-read s 'ebdb-db t))))
+ ;; Handle new/nonexistent databases.
+ (when (yes-or-no-p (format "%s does not exist, create? " s))
+ (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))
+ (error "Source %s must be a filename or instance of `ebdb-db'."
s)))
;; Now load it.
- (if (child-of-class-p (eieio-object-class s) 'ebdb-db)
+ (if (object-of-class-p s 'ebdb-db)
(if (null (slot-value s 'disabled))
(ebdb-db-load s)
(message "Database %s is currently disabled." s)
@@ -4385,10 +4386,11 @@ important work is done by the `ebdb-db-load' method."
(null ebdb-record-tracker)
(bound-and-true-p bbdb-file)
(file-exists-p bbdb-file))
- ;; We're migrating from a previous version of EBDB.
- (ebdb-migrate-from-bbdb)
- (message "Loading EBDB sources... done"))
+ ;; We're migrating from a version of BBDB.
+ (ebdb-migrate-from-bbdb))
+ (message "Initializing EBDB records...")
(ebdb-initialize)
+ (message "Initializing EBDB records... done")
;; Users will expect the same ordering as `ebdb-sources'
(setq ebdb-db-list (nreverse ebdb-db-list))
(run-hooks 'ebdb-after-load-hook)
- [elpa] externals/ebdb e50a437 043/350: When unloading, don't remove records from the db's record slot, (continued)
- [elpa] externals/ebdb e50a437 043/350: When unloading, don't remove records from the db's record slot, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5ce28dc 048/350: Remove ebdb-file-coding-system variable, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 886cfd0 054/350: Change gnorb tags field to plain org tags field, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9a42885 061/350: ebdb-prompt-for-mail should return single mails with no prompt, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb e4f1cf5 046/350: Fix broken quoting for organization simple name reading, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9e2c0e8 049/350: Fix logic of loading records from multiple databases, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bd9dd94 072/350: Use ebdb-defunct face on defunct role fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 2ec61be 059/350: Fixup bbdb-mode keymap, menu, and docstring, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb e49e9da 077/350: Using wrong var name in ebdb-edit-field, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 794babc 069/350: Fix mail field action, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7d41fb9 076/350: Small tweaks to ebdb-load,
Eric Abrahamsen <=
- [elpa] externals/ebdb 5156eb2 079/350: Rename ebdb-display-one-record to ebdb-search-single-record, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 3a0048f 041/350: Stop pretended init and delete are the same for records and fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ca4516b 082/350: Use mail-decode-encoded-word-string on returned MUA headers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5910db7 065/350: Restore mail alias functionality, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 55a8c97 085/350: Split ebdb-db-disable into interactive/non-interactive functions, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb fb76dd3 032/350: Fix ebdb-search-duplicates, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a43e883 026/350: Move record initialization out of load process, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 77eb15b 037/350: Add keybinding for ebdb-search-database, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8eb2262 036/350: Add object-print method for records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 20785a1 029/350: Additions to README and manual, Eric Abrahamsen, 2017/08/14