summaryrefslogtreecommitdiff
path: root/lisp/custom.el
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>1999-03-04 18:12:46 +0000
committerDave Love <fx@gnu.org>1999-03-04 18:12:46 +0000
commitce9e3d0b4eeb1bcfa1e7120b54b4a241d79849d7 (patch)
tree94dea31595189cafd8c850e643926e66ec9310b8 /lisp/custom.el
parent06b62b06d342d5c5c55e467b24253fef4d96f8cf (diff)
downloademacs-ce9e3d0b4eeb1bcfa1e7120b54b4a241d79849d7.tar.gz
(custom-set-variables): Protect against setter errors.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r--lisp/custom.el18
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'")