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

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

[elpa] externals/ebdb 235dad2 10/33: Fix to database disabling


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 235dad2 10/33: Fix to database disabling
Date: Sun, 3 Sep 2017 17:02:20 -0400 (EDT)

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

    Fix to database disabling
    
    * ebdb.el (ebdb-db-disable): Previously this was a catch-22 -- setting
      the disabled slot to t meant that ebdb-db-save would always error.
      Use the new "force" argument to ebdb-db-save to prevent that
      happening.
---
 ebdb.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/ebdb.el b/ebdb.el
index ba3c97b..1b3ebe3 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -3721,10 +3721,14 @@ the persistent save, or allow them to propagate.")
 (cl-defmethod ebdb-string ((db ebdb-db))
   (format "Database: %s" (slot-value db 'file)))
 
+(cl-defgeneric ebdb-db-disable (db)
+  "Disable DB.
+DB will be unconditionally saved to disk as part of the disable
+process.")
+
 (cl-defmethod ebdb-db-disable ((db ebdb-db))
-  (setf (slot-value db 'disabled) t
-       (slot-value db 'dirty) t)
-  (ebdb-db-save db)
+  (setf (slot-value db 'disabled) t)
+  (ebdb-db-save db nil t)
   (ebdb-db-unload db))
 
 (cl-defmethod ebdb-db-customize ((db ebdb-db))



reply via email to

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