]> code.delx.au - gnu-emacs/blobdiff - lisp/cus-edit.el
(rmail-highlight): Fix specification.
[gnu-emacs] / lisp / cus-edit.el
index 40ff46f1675ccf87480c5c30bae0d963bffc0150..0446102eb09d260dd1b8bf6acb3a46643c2aed7a 100644 (file)
@@ -1,7 +1,7 @@
 ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages
 ;;
 ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: FSF
@@ -1412,7 +1412,7 @@ that are not customizable options, as well as faces and groups
 (defun customize-apropos-options (regexp &optional arg)
   "Customize all loaded customizable options matching REGEXP.
 With prefix arg, include variables that are not customizable options
-\(but we recommend using `apropos-variable' instead)."
+\(but it is better to use `apropos-variable' if you want to find those)."
   (interactive "sCustomize options (regexp): \nP")
   (customize-apropos regexp (or arg 'options)))
 
@@ -2313,7 +2313,8 @@ Insert PREFIX first if non-nil."
               (insert ", "))))
       (widget-put widget :buttons buttons))))
 
-(defun custom-add-parent-links (widget &optional initial-string)
+(defun custom-add-parent-links (widget &optional initial-string
+                                      doc-initial-string)
   "Add \"Parent groups: ...\" to WIDGET if the group has parents.
 The value is non-nil if any parents were found.
 If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
@@ -2322,7 +2323,7 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
        (buttons (widget-get widget :buttons))
        (start (point))
        (parents nil))
-    (insert (or initial-string "Parent groups:"))
+    (insert (or initial-string "Groups:"))
     (mapatoms (lambda (symbol)
                (when (member (list name type) (get symbol 'custom-group))
                  (insert " ")
@@ -2341,23 +2342,27 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
                                         (get (car parents) 'custom-links))))
                 (many (> (length links) 2)))
            (when links
-             (insert "\nParent documentation: ")
-             (while links
-               (push (widget-create-child-and-convert
-                     widget (car links)
-                     :button-face 'custom-link
-                     :mouse-face 'highlight
-                     :pressed-face 'highlight)
-                     buttons)
-               (setq links (cdr links))
-               (cond ((null links)
-                      (insert ".\n"))
-                     ((null (cdr links))
-                      (if many
-                          (insert ", and ")
-                        (insert " and ")))
-                     (t
-                      (insert ", ")))))))
+             (let ((pt (point))
+                   (left-margin (+ left-margin 2)))
+              (insert "\n" (or doc-initial-string "Group documentation:") " ")
+              (while links
+                (push (widget-create-child-and-convert
+                       widget (car links)
+                       :button-face 'custom-link
+                       :mouse-face 'highlight
+                       :pressed-face 'highlight)
+                      buttons)
+                (setq links (cdr links))
+                (cond ((null links)
+                       (insert ".\n"))
+                      ((null (cdr links))
+                       (if many
+                           (insert ", and ")
+                         (insert " and ")))
+                      (t
+                        (insert ", "))))
+               (fill-region-as-paragraph pt (point))
+               (delete-to-left-margin (1+ pt) (+ pt 2))))))
     (if parents
         (insert "\n")
       (delete-region start (point)))
@@ -3940,7 +3945,8 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
                    ;;; was made to display a group.
               (when (eq level 1)
                 (if (custom-add-parent-links widget
-                                             "Parent groups:")
+                                             "Parent groups:"
+                                             "Parent group documentation:")
                     (insert "\n"))))
           ;; Create level indicator.
           (insert-char ?\  (* custom-buffer-indent (1- level)))