summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-06-21 18:51:28 +0000
committerRichard M. Stallman <rms@gnu.org>1997-06-21 18:51:28 +0000
commitd377bee9887e8ebeed65ab6fd8d6eaf5bf70354c (patch)
treecfa8be6964cbde8fa3a2b6d1f61a2d6a3190e5ce /lisp/cus-edit.el
parent515c9d0d0876ba4b51809e16f3a0dd80fd822bea (diff)
downloademacs-d377bee9887e8ebeed65ab6fd8d6eaf5bf70354c.tar.gz
(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.
Diffstat (limited to 'lisp/cus-edit.el')
-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."
(widget-put widget :buttons buttons))))
(defun custom-add-parent-links (widget)
- "Add `Parent groups: ...' to WIDGET."
+ "Add `Parent groups: ...' to WIDGET.
+The value if non-nil if there are parents."
(let ((name (widget-value widget))
(type (widget-type widget))
(buttons (widget-get widget :buttons))
+ (start (point))
found)
(insert "Parent groups:")
(mapatoms (lambda (symbol)
@@ -1546,9 +1548,10 @@ Insert PREFIX first if non-nil."
buttons)
(setq found t))))))
(widget-put widget :buttons buttons)
- (unless found
- (insert " (none)"))
- (insert "\n")))
+ (if found
+ (insert "\n")
+ (delete-region start (point)))
+ found))
;;; The `custom-variable' Widget.
@@ -2506,6 +2509,12 @@ and so forth. The remaining group tags are shown with
(widget-default-format-handler widget ?h))
;; Nested style.
(t ;Visible.
+ ;; Add parent groups references above the group.
+ (if t ;;; This should test that the buffer
+ ;;; was made to display a group.
+ (when (eq level 1)
+ (if (custom-add-parent-links widget)
+ (insert "\n"))))
;; Create level indicator.
(insert-char ?\ (* custom-buffer-indent (1- level)))
(insert "/- ")
@@ -2541,10 +2550,12 @@ and so forth. The remaining group tags are shown with
(widget-put widget :buttons buttons)
;; Insert documentation.
(widget-default-format-handler widget ?h)
- ;; Parents and See also.
- (when (eq level 1)
- (insert-char ?\ custom-buffer-indent)
- (custom-add-parent-links widget))
+ ;; Parent groups.
+ (if nil ;;; This should test that the buffer
+ ;;; was not made to display a group.
+ (when (eq level 1)
+ (insert-char ?\ custom-buffer-indent)
+ (custom-add-parent-links widget)))
(custom-add-see-also widget
(make-string (* custom-buffer-indent level)
?\ ))