[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 4263d5b 090/350: Fix the reload process
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 4263d5b 090/350: Fix the reload process |
Date: |
Mon, 14 Aug 2017 11:46:13 -0400 (EDT) |
branch: externals/ebdb
commit 4263d5b7cef36985ff91a311e477f39bffe1102e
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Fix the reload process
* ebdb.el (ebdb-db-reload): The actual database object needs to be
re-read from the persistence file.
(ebdb-db-unsynced): We should be checking modification time, not
access time. And use the provided accessor.
---
ebdb.el | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index ee987f8..89b3dae 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2874,12 +2874,12 @@ somehow out of sync.
DB has unsaved changes. Unsynced means that saving those
changes (or re-loading the database from its source) would
overwrite data somewhere."
- (let ((file-access-time
- (nth 4
- (file-attributes
- (expand-file-name (slot-value db 'file))))))
- (and file-access-time
- (time-less-p (slot-value db 'sync-time) file-access-time))))
+ (let ((file-mod-time
+ (file-attribute-modification-time
+ (file-attributes
+ (expand-file-name (slot-value db 'file))))))
+ (and file-mod-time
+ (time-less-p (slot-value db 'sync-time) file-mod-time))))
(cl-defmethod ebdb-db-dirty ((db ebdb-db))
"Return t if DB is marked dirty, or contains any dirty records."
@@ -2967,8 +2967,17 @@ that doesn't belong to a different database."
(object-remove-from-list (ebdb-record-cache r) 'database db))))
(defun ebdb-db-reload (db)
- (ebdb-db-unload db)
- (ebdb-db-load db))
+ "Reload DB.
+
+This consists of unloading all DB's records, re-reading its
+database definition from file, and then reloading all the
+records."
+ (let ((elt (cl-position db ebdb-db-list)))
+ (ebdb-db-unload db)
+ (setq db (eieio-persistent-read (slot-value db 'file) 'ebdb-db t))
+ ;; Stick DB back where it came from.
+ (setcar (nthcdr elt ebdb-db-list) db)
+ (ebdb-db-load db)))
(cl-defmethod ebdb-record-compare ((left ebdb-record)
(right ebdb-record)
- [elpa] externals/ebdb f397e3d 092/350: Add missing require statement, (continued)
- [elpa] externals/ebdb f397e3d 092/350: Add missing require statement, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ae23a9b 095/350: Fix to ebdb-parse with field-name-simple, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6197578 107/350: Change default separator of org tags, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f1edaed 075/350: Prevent eieio-persistent-save from changing db file slot, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c7d378b 071/350: Autoload eieio-customize-object, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 31bf2cf 117/350: No, that's not the proper way to create a &context catchall, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a2de313 110/350: Install ebdb-save as a kill-emacs-hook, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ab1480b 078/350: Remove ebdb-this-buffer-name, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1c4fadd 080/350: Make ebdb-record-name a get-or-get-and-set operation, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9aab682 088/350: Add a generic for ebdb-db-editable, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4263d5b 090/350: Fix the reload process,
Eric Abrahamsen <=
- [elpa] externals/ebdb dd4f251 098/350: Split off ebdb-record-field for field classes, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8c20202 103/350: Update company-ebdb to work with new search style, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5ec40d5 102/350: Add sections on searching and record marking to manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7da77f4 089/350: Expand ebdb-with-record-edits, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8312ea4 109/350: Allow company-ebdb to work in notmuch-message-mode as well, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dcb7dbc 104/350: Change default keybindings in Gnus, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9ac0f0f 111/350: Searching on empty strings should happen in field-search method, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c43e39b 097/350: Another round of compiler-inspired fixes, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 40df5bc 114/350: Remove ebdb-new-mails-primary, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 825c4cc 112/350: Simplify the structure of ebdb-org-hashtable, Eric Abrahamsen, 2017/08/14