diff options
author | Dave Love <fx@gnu.org> | 1999-03-04 18:12:46 +0000 |
---|---|---|
committer | Dave Love <fx@gnu.org> | 1999-03-04 18:12:46 +0000 |
commit | 733e8270d8af473684987d77370f3f93c4fc1c0d (patch) | |
tree | b32bbf6eb3a1d77fc6800a4ba286d27a8578b526 /lisp/custom.el | |
parent | 7f8a0840756e1f3d00c3675f000b169a109652ce (diff) | |
download | emacs-733e8270d8af473684987d77370f3f93c4fc1c0d.tar.gz |
(custom-set-variables): Protect against setter errors.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r-- | lisp/custom.el | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/custom.el b/lisp/custom.el index 5f08474ddc7..869681227ba 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -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'") |