1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

(custom-set-variables): Protect against setter errors.

This commit is contained in:
Dave Love 1999-03-04 18:12:46 +00:00
parent 7f8a084075
commit 733e8270d8

View File

@ -414,13 +414,17 @@ the default value for the SYMBOL."
(mapcar 'require requests)) (mapcar 'require requests))
(setq set (or (get symbol 'custom-set) 'custom-set-default)) (setq set (or (get symbol 'custom-set) 'custom-set-default))
(put symbol 'saved-value (list value)) (put symbol 'saved-value (list value))
(cond (now ;; Allow for errors in the case where the setter has
;; Rogue variable, set it now. ;; changed between versions, say.
(put symbol 'force-value t) (condition-case nil
(funcall set symbol (eval value))) (cond (now
((default-boundp symbol) ;; Rogue variable, set it now.
;; Something already set this, overwrite it. (put symbol 'force-value t)
(funcall set symbol (eval value)))) (funcall set symbol (eval value)))
((default-boundp symbol)
;; Something already set this, overwrite it.
(funcall set symbol (eval value))))
(error nil))
(setq args (cdr args))) (setq args (cdr args)))
;; Old format, a plist of SYMBOL VALUE pairs. ;; Old format, a plist of SYMBOL VALUE pairs.
(message "Warning: old format `custom-set-variables'") (message "Warning: old format `custom-set-variables'")