From 2092fb0b9a36775e22efc5fd967a05f6e4bffbeb Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Mon, 30 Dec 2019 18:10:28 -0300 Subject: [PATCH] Reset to the standard value when reverting session's customization * lisp/cus-edit.el (custom-variable-reset-saved): When there is no previous saved value, reset to the standard value. (Bug#15214) --- lisp/cus-edit.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 439667a..4fa6dfe 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3038,8 +3038,11 @@ custom-variable-reset-saved (comment (get symbol 'saved-variable-comment))) (custom-variable-backup-value widget) (if (not (or saved-value comment)) - ;; If there is no saved value, remove the setting. - (custom-push-theme 'theme-value symbol 'user 'reset) + (progn + ;; If there is no saved value, remove the setting. + (custom-push-theme 'theme-value symbol 'user 'reset) + (funcall (or (get symbol 'custom-set) #'set-default) symbol + (eval (car (get symbol 'standard-value))))) ;; Otherwise, apply the saved value. (put symbol 'variable-comment comment) (custom-push-theme 'theme-value symbol 'user 'set (car-safe saved-value)) -- 2.7.4