changeset 24438:4a78f6354310

(custom-set-variables): Protect against setter errors.
author Dave Love <fx@gnu.org>
date Thu, 04 Mar 1999 18:12:46 +0000
parents 8a9d8919ebe8
children 56916b0de547
files lisp/custom.el
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/custom.el	Thu Mar 04 11:35:42 1999 +0000
+++ b/lisp/custom.el	Thu Mar 04 18:12:46 1999 +0000
@@ -414,13 +414,17 @@
 	      (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'")