]> git.eshelyaron.com Git - emacs.git/commitdiff
2003-11-30 Per Abrahamsen <abraham@dina.kvl.dk>
authorPer Abrahamsen <abraham@dina.kvl.dk>
Tue, 2 Dec 2003 15:01:52 +0000 (15:01 +0000)
committerPer Abrahamsen <abraham@dina.kvl.dk>
Tue, 2 Dec 2003 15:01:52 +0000 (15:01 +0000)
* cus-edit.el (custom-add-parent-links): Add documentation links
for parent, if the item has none of its own.

lisp/ChangeLog
lisp/cus-edit.el

index b6fba5cdea2008cc9ebbd90dc1d7c03d5ab3cf17..84746d2a3250f09e9b767f04491b8f70934821c0 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2003-11-30  Richard M. Stallman  <rms@gnu.org>
 
        * dired-aux.el (dired-do-query-replace-regexp):
index f33e56a02aa0512181956f2c38b21ae504d4cb1d..bf92e8df9cfca568f9bfdc431ab0ae33b53b21bd 100644 (file)
@@ -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.