changeset 33025:9559a9aeff3c

(custom-add-to-group): Allow multiple entries for a given value OPTION, as long as their widget types are different.
author Miles Bader <miles@gnu.org>
date Sun, 29 Oct 2000 14:49:58 +0000
parents 42e118959715
children 61f1eb6cd967
files lisp/custom.el
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/custom.el	Sun Oct 29 14:49:01 2000 +0000
+++ b/lisp/custom.el	Sun Oct 29 14:49:58 2000 +0000
@@ -319,12 +319,12 @@
 
 (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)))
+    (message "adding %s" entry)
+    (unless (member entry members)
+      (put group 'custom-group (nconc members (list entry))))))
 
 ;;; Properties.