diff options
author | Per Abrahamsen <abraham@dina.kvl.dk> | 2003-12-02 15:01:52 +0000 |
---|---|---|
committer | Per Abrahamsen <abraham@dina.kvl.dk> | 2003-12-02 15:01:52 +0000 |
commit | ac00d71ca6cbfef92a13f39d26633ba23281bc84 (patch) | |
tree | d76ef65a10f1eb131919726a1c0e181f112c51cd /lisp/cus-edit.el | |
parent | 3999c70516b3eed8554b9e13ebdf7ae3f8ea6601 (diff) | |
download | emacs-ac00d71ca6cbfef92a13f39d26633ba23281bc84.tar.gz |
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
* cus-edit.el (custom-add-parent-links): Add documentation links
for parent, if the item has none of its own.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r-- | lisp/cus-edit.el | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index f33e56a02aa..bf92e8df9cf 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1956,7 +1956,7 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." (type (widget-type widget)) (buttons (widget-get widget :buttons)) (start (point)) - found) + (parents nil)) (insert (or initial-string "Parent groups:")) (mapatoms (lambda (symbol) (let ((entry (assq name (get symbol 'custom-group)))) @@ -1967,12 +1967,29 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." :tag (custom-unlispify-tag-name symbol) symbol) buttons) - (setq found t))))) - (widget-put widget :buttons buttons) - (if found - (insert "\n") + (setq parents (cons symbol parents)))))) + (and (null (get symbol 'custom-links)) ;No links of its own. + (= (length parents) 1) ;A single parent. + (let ((links (get (car parents) 'custom-links))) + (when links + (insert "\nParent documentation: ") + (while links + (push (widget-create-child-and-convert widget (car links)) + buttons) + (setq links (cdr links)) + (cond ((null links) + (insert ".\n")) + ((null (cdr links)) + (if many + (insert ", and ") + (insert " and "))) + (t + (insert ", "))))))) + (if parents + (insert "\n") (delete-region start (point))) - found)) + (widget-put widget :buttons buttons) + parents)) ;;; The `custom-comment' Widget. |