# HG changeset patch # User Per Abrahamsen # Date 1070377312 0 # Node ID 1fa5a4fc03e58dbfd063487dec00b151b32c55f7 # Parent 4050f3f8034009d4225123e813697e05db79223c 2003-11-30 Per Abrahamsen * cus-edit.el (custom-add-parent-links): Add documentation links for parent, if the item has none of its own. diff -r 4050f3f80340 -r 1fa5a4fc03e5 lisp/ChangeLog --- a/lisp/ChangeLog Mon Dec 01 13:06:41 2003 +0000 +++ b/lisp/ChangeLog Tue Dec 02 15:01:52 2003 +0000 @@ -1,3 +1,8 @@ +2003-11-30 Per Abrahamsen + + * cus-edit.el (custom-add-parent-links): Add documentation links + for parent, if the item has none of its own. + 2003-11-30 Richard M. Stallman * dired-aux.el (dired-do-query-replace-regexp): diff -r 4050f3f80340 -r 1fa5a4fc03e5 lisp/cus-edit.el --- a/lisp/cus-edit.el Mon Dec 01 13:06:41 2003 +0000 +++ b/lisp/cus-edit.el Tue Dec 02 15:01:52 2003 +0000 @@ -1956,7 +1956,7 @@ (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 @@ :tag (custom-unlispify-tag-name symbol) symbol) buttons) - (setq found t))))) + (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))) (widget-put widget :buttons buttons) - (if found - (insert "\n") - (delete-region start (point))) - found)) + parents)) ;;; The `custom-comment' Widget.