From 733e8270d8af473684987d77370f3f93c4fc1c0d Mon Sep 17 00:00:00 2001 From: Dave Love Date: Thu, 4 Mar 1999 18:12:46 +0000 Subject: [PATCH] (custom-set-variables): Protect against setter errors. --- lisp/custom.el | 18 +++++++++++------- 1 file 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'") -- 2.39.2