emacs-diffs
[Top][All Lists]
Advanced

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

emacs-27 8addfa9: Reset to the standard value when reverting session's c


From: Eli Zaretskii
Subject: emacs-27 8addfa9: Reset to the standard value when reverting session's customizations
Date: Sat, 11 Jan 2020 03:38:38 -0500 (EST)

branch: emacs-27
commit 8addfa91c8e242d465828c7c8a7a1aa6b06060fc
Author: Mauro Aranda <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Reset to the standard value when reverting session's customizations
    
    * 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 | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 0ca3f1e..d3d17fd 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3035,17 +3035,18 @@ Update the widget to show that value.  The value that 
was current
 before this operation becomes the backup value."
   (let* ((symbol (widget-value widget))
         (saved-value (get symbol 'saved-value))
-        (comment (get symbol 'saved-variable-comment)))
+        (comment (get symbol 'saved-variable-comment))
+         value)
     (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)
-      ;; Otherwise, apply the saved value.
-      (put symbol 'variable-comment comment)
-      (custom-push-theme 'theme-value symbol 'user 'set (car-safe saved-value))
-      (ignore-errors
-       (funcall (or (get symbol 'custom-set) 'set-default)
-                symbol (eval (car saved-value)))))
+        ;; If there is no saved value, remove the setting.
+        (custom-push-theme 'theme-value symbol 'user 'reset)
+      (setq value (car-safe saved-value))
+      (custom-push-theme 'theme-value symbol 'user 'set value)
+      (put symbol 'variable-comment comment))
+    (ignore-errors
+      (funcall (or (get symbol 'custom-set) #'set-default) symbol
+               (eval (or value (car (get symbol 'standard-value))))))
     (put symbol 'customized-value nil)
     (put symbol 'customized-variable-comment nil)
     (widget-put widget :custom-state 'unknown)



reply via email to

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