emacs-diffs
[Top][All Lists]
Advanced

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

master f2bd536 3/3: Make custom-data saving atomic


From: Lars Ingebrigtsen
Subject: master f2bd536 3/3: Make custom-data saving atomic
Date: Fri, 4 Dec 2020 06:15:36 -0500 (EST)

branch: master
commit f2bd536d36a89dac2a70c6a706d851ff73bcc40f
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make custom-data saving atomic
    
    * lisp/cus-edit.el (custom-save-all): Do the custom saves as an
    atomic change group, to avoid writing invalid data if something
    goes wrong (or the user hits `C-g') in the middle (bug#18633).
---
 lisp/cus-edit.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index a00cb17..3a36cb0 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4717,8 +4717,9 @@ if only the first line of the docstring is shown."))
       (let ((inhibit-read-only t)
            (print-length nil)
            (print-level nil))
-       (custom-save-variables)
-       (custom-save-faces))
+        (atomic-change-group
+         (custom-save-variables)
+         (custom-save-faces)))
       (let ((file-precious-flag t))
        (save-buffer))
       (if old-buffer



reply via email to

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