(Info-forward-node): If the node has an
[bpt/emacs.git] / lisp / custom.el
index ea7afc4..8725e7b 100644 (file)
@@ -137,8 +137,8 @@ not the default value itself."
                ((eq keyword :options)
                 (if (get symbol 'custom-options)
                     ;; Slow safe code to avoid duplicates.
-                    (mapcar (lambda (option)
-                              (custom-add-option symbol option))
+                    (mapc (lambda (option)
+                            (custom-add-option symbol option))
                             value)
                   ;; Fast code for the common case.
                   (put symbol 'custom-options (copy-sequence value))))
@@ -319,12 +319,11 @@ information."
 
 (defun custom-add-to-group (group option widget)
   "To existing GROUP add a new OPTION of type WIDGET.
-If there already is an entry for that option, overwrite it."
-  (let* ((members (get group 'custom-group))
-        (old (assq option members)))
-    (if old
-       (setcar (cdr old) widget)
-      (put group 'custom-group (nconc members (list (list option widget)))))))
+If there already is an entry for OPTION and WIDGET, nothing is done."
+  (let ((members (get group 'custom-group))
+       (entry (list option widget)))
+    (unless (member entry members)
+      (put group 'custom-group (nconc members (list entry))))))
 
 ;;; Properties.
 
@@ -453,7 +452,7 @@ COMMENT is a comment string about SYMBOL."
                 set)
            (when requests
              (put symbol 'custom-requests requests)
-             (mapcar 'require requests))
+             (mapc 'require requests))
            (setq set (or (get symbol 'custom-set) 'custom-set-default))
            (put symbol 'saved-value (list value))
            (put symbol 'saved-variable-comment comment)