From: Lars Ingebrigtsen Date: Fri, 4 Dec 2020 11:15:26 +0000 (+0100) Subject: Make custom-data saving atomic X-Git-Tag: emacs-28.0.90~4928 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f2bd536d36a89dac2a70c6a706d851ff73bcc40f;p=emacs.git 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). --- 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