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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb 3cb827e 181/350: Check for existence of fiel-attri


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 3cb827e 181/350: Check for existence of fiel-attribute-modification-time
Date: Mon, 14 Aug 2017 11:46:31 -0400 (EDT)

branch: externals/ebdb
commit 3cb827e49092e625f0a8a947a019c5ef7335c347
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    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))))
 



reply via email to

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