branch: externals/ebdb
commit f1edaed91bc74b8958420508a282daaa155cdc34
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
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.