1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +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))
(setq set (or (get symbol 'custom-set) 'custom-set-default))
(put symbol 'saved-value (list value))
(cond (now
;; Rogue variable, set it now.
(put symbol 'force-value t)
(funcall set symbol (eval value)))
((default-boundp symbol)
;; Something already set this, overwrite it.
(funcall set symbol (eval value))))
;; Allow for errors in the case where the setter has
;; changed between versions, say.
(condition-case nil
(cond (now
;; Rogue variable, set it now.
(put symbol 'force-value t)
(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)))
;; Old format, a plist of SYMBOL VALUE pairs.
(message "Warning: old format `custom-set-variables'")