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

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

[elpa] externals/ebdb f1edaed 075/350: Prevent eieio-persistent-save fro


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb f1edaed 075/350: Prevent eieio-persistent-save from changing db file slot
Date: Mon, 14 Aug 2017 11:46:06 -0400 (EDT)

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

    Prevent eieio-persistent-save from changing db file slot
    
    Fixes #11
    
    * ebdb.el (ebdb-db-do-auto-save): Don't let the persistent save call
      change the db filename to the autosave filename.
---
 ebdb.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/ebdb.el b/ebdb.el
index 36d8494..64124c5 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2791,10 +2791,15 @@ not be instantiated directly, subclass it instead."
            "#")))
 
 (cl-defmethod ebdb-db-do-auto-save ((db ebdb-db))
-  (let ((auto-save-file
-        (ebdb-db-make-auto-save-file-name
-         (slot-value db 'file))))
-    (eieio-persistent-save db auto-save-file)))
+  (let* ((orig-file (slot-value db 'file))
+        (auto-save-file
+         (ebdb-db-make-auto-save-file-name
+          orig-file)))
+    (eieio-persistent-save db auto-save-file)
+    ;; The call to `eieio-persistent-save' sets the 'file slot to the
+    ;; auto-save-file name, for some reason, see FIXME in there.
+    ;; Setting it back ought to have us covered.
+    (setf (slot-value db 'file) orig-file)))
 
 (defun ebdb-auto-save-databases ()
   "Auto-save all EBDB databases.



reply via email to

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