branch: externals/ebdb
commit 3cb827e49092e625f0a8a947a019c5ef7335c347
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Check for existence of fiel-attribute-modification-time
Fixes #19
* ebdb.el (ebdb-db-unsynced): It was added in Emacs 26.1.
---
ebdb.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 717f809..5520584 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2839,10 +2839,14 @@ 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-mod-time
- (file-attribute-modification-time
+ (let* ((file-attrs
(file-attributes
- (expand-file-name (slot-value db 'file))))))
+ (expand-file-name (slot-value db 'file))))
+ (file-mod-time
+ ;; This accessor was added in 26.1, we support Emacs 25.
+ (if (fboundp 'file-attribute-modification-time)
+ (file-attribute-modification-time file-attrs)
+ (nth 5 file-attrs))))
(and file-mod-time
(time-less-p (slot-value db 'sync-time) file-mod-time))))