comparison lisp/cus-edit.el @ 66904:b39a51cbc6b6

(custom-add-parent-links): Fix bug whereby, for instance, `(fringe custom-face)' shadowed `(fringe custom-group)' in the custom-group property of the symbol frames and the fringe group got no link to its parent group frames. Doc fix.
author Luc Teirlinck <teirllm@auburn.edu>
date Wed, 16 Nov 2005 02:02:03 +0000
parents b148d2fdff12
children 1710aca8150f
comparison
equal deleted inserted replaced
66903:4689a51b18f9 66904:b39a51cbc6b6
2122 (insert ", ")))) 2122 (insert ", "))))
2123 (widget-put widget :buttons buttons)))) 2123 (widget-put widget :buttons buttons))))
2124 2124
2125 (defun custom-add-parent-links (widget &optional initial-string) 2125 (defun custom-add-parent-links (widget &optional initial-string)
2126 "Add \"Parent groups: ...\" to WIDGET if the group has parents. 2126 "Add \"Parent groups: ...\" to WIDGET if the group has parents.
2127 The value if non-nil if any parents were found. 2127 The value is non-nil if any parents were found.
2128 If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." 2128 If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
2129 (let ((name (widget-value widget)) 2129 (let ((name (widget-value widget))
2130 (type (widget-type widget)) 2130 (type (widget-type widget))
2131 (buttons (widget-get widget :buttons)) 2131 (buttons (widget-get widget :buttons))
2132 (start (point)) 2132 (start (point))
2133 (parents nil)) 2133 (parents nil))
2134 (insert (or initial-string "Parent groups:")) 2134 (insert (or initial-string "Parent groups:"))
2135 (mapatoms (lambda (symbol) 2135 (mapatoms (lambda (symbol)
2136 (let ((entry (assq name (get symbol 'custom-group)))) 2136 (when (member (list name type) (get symbol 'custom-group))
2137 (when (eq (nth 1 entry) type) 2137 (insert " ")
2138 (insert " ") 2138 (push (widget-create-child-and-convert
2139 (push (widget-create-child-and-convert 2139 widget 'custom-group-link
2140 widget 'custom-group-link 2140 :tag (custom-unlispify-tag-name symbol)
2141 :tag (custom-unlispify-tag-name symbol) 2141 symbol)
2142 symbol) 2142 buttons)
2143 buttons) 2143 (setq parents (cons symbol parents)))))
2144 (setq parents (cons symbol parents))))))
2145 (and (null (get name 'custom-links)) ;No links of its own. 2144 (and (null (get name 'custom-links)) ;No links of its own.
2146 (= (length parents) 1) ;A single parent. 2145 (= (length parents) 1) ;A single parent.
2147 (let* ((links (get (car parents) 'custom-links)) 2146 (let* ((links (get (car parents) 'custom-links))
2148 (many (> (length links) 2))) 2147 (many (> (length links) 2)))
2149 (when links 2148 (when links