aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-06-21 18:51:28 +0000
committerRichard M. Stallman1997-06-21 18:51:28 +0000
commitd377bee9887e8ebeed65ab6fd8d6eaf5bf70354c (patch)
treecfa8be6964cbde8fa3a2b6d1f61a2d6a3190e5ce
parent515c9d0d0876ba4b51809e16f3a0dd80fd822bea (diff)
downloademacs-d377bee9887e8ebeed65ab6fd8d6eaf5bf70354c.tar.gz
emacs-d377bee9887e8ebeed65ab6fd8d6eaf5bf70354c.zip
(custom-group-value-create): Use group-visibility widget.
(custom-add-parent-links): Don't insert anything if no parents. Return non-nil iff do have parents.
-rw-r--r--lisp/cus-edit.el27
1 files changed, 19 insertions, 8 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 1740411a2fc..b6f4dff616c 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1528,10 +1528,12 @@ Insert PREFIX first if non-nil."
1528 (widget-put widget :buttons buttons)))) 1528 (widget-put widget :buttons buttons))))
1529 1529
1530(defun custom-add-parent-links (widget) 1530(defun custom-add-parent-links (widget)
1531 "Add `Parent groups: ...' to WIDGET." 1531 "Add `Parent groups: ...' to WIDGET.
1532The value if non-nil if there are parents."
1532 (let ((name (widget-value widget)) 1533 (let ((name (widget-value widget))
1533 (type (widget-type widget)) 1534 (type (widget-type widget))
1534 (buttons (widget-get widget :buttons)) 1535 (buttons (widget-get widget :buttons))
1536 (start (point))
1535 found) 1537 found)
1536 (insert "Parent groups:") 1538 (insert "Parent groups:")
1537 (mapatoms (lambda (symbol) 1539 (mapatoms (lambda (symbol)
@@ -1546,9 +1548,10 @@ Insert PREFIX first if non-nil."
1546 buttons) 1548 buttons)
1547 (setq found t)))))) 1549 (setq found t))))))
1548 (widget-put widget :buttons buttons) 1550 (widget-put widget :buttons buttons)
1549 (unless found 1551 (if found
1550 (insert " (none)")) 1552 (insert "\n")
1551 (insert "\n"))) 1553 (delete-region start (point)))
1554 found))
1552 1555
1553;;; The `custom-variable' Widget. 1556;;; The `custom-variable' Widget.
1554 1557
@@ -2506,6 +2509,12 @@ and so forth. The remaining group tags are shown with
2506 (widget-default-format-handler widget ?h)) 2509 (widget-default-format-handler widget ?h))
2507 ;; Nested style. 2510 ;; Nested style.
2508 (t ;Visible. 2511 (t ;Visible.
2512 ;; Add parent groups references above the group.
2513 (if t ;;; This should test that the buffer
2514 ;;; was made to display a group.
2515 (when (eq level 1)
2516 (if (custom-add-parent-links widget)
2517 (insert "\n"))))
2509 ;; Create level indicator. 2518 ;; Create level indicator.
2510 (insert-char ?\ (* custom-buffer-indent (1- level))) 2519 (insert-char ?\ (* custom-buffer-indent (1- level)))
2511 (insert "/- ") 2520 (insert "/- ")
@@ -2541,10 +2550,12 @@ and so forth. The remaining group tags are shown with
2541 (widget-put widget :buttons buttons) 2550 (widget-put widget :buttons buttons)
2542 ;; Insert documentation. 2551 ;; Insert documentation.
2543 (widget-default-format-handler widget ?h) 2552 (widget-default-format-handler widget ?h)
2544 ;; Parents and See also. 2553 ;; Parent groups.
2545 (when (eq level 1) 2554 (if nil ;;; This should test that the buffer
2546 (insert-char ?\ custom-buffer-indent) 2555 ;;; was not made to display a group.
2547 (custom-add-parent-links widget)) 2556 (when (eq level 1)
2557 (insert-char ?\ custom-buffer-indent)
2558 (custom-add-parent-links widget)))
2548 (custom-add-see-also widget 2559 (custom-add-see-also widget
2549 (make-string (* custom-buffer-indent level) 2560 (make-string (* custom-buffer-indent level)
2550 ?\ )) 2561 ?\ ))