From f2bd536d36a89dac2a70c6a706d851ff73bcc40f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 4 Dec 2020 12:15:26 +0100 Subject: [PATCH] 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 a00cb17e298..3a36cb02373 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 -- 2.39.5