Function: custom-add-see-also

custom-add-see-also is a byte-compiled function defined in cus-edit.el.gz.

Signature

(custom-add-see-also WIDGET &optional PREFIX)

Documentation

Add See also ... to WIDGET if there are any links.

Insert PREFIX first if non-nil.

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun custom-add-see-also (widget &optional prefix)
  "Add `See also ...' to WIDGET if there are any links.
Insert PREFIX first if non-nil."
  (let* ((symbol (widget-get widget :value))
	 (links (get symbol 'custom-links))
	 (many (> (length links) 2))
	 (buttons (widget-get widget :buttons))
	 (indent (widget-get widget :indent)))
    (when links
      (when indent
	(insert-char ?\s indent))
      (when prefix
	(insert prefix))
      (insert "See also ")
      (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 ", "))))
      (widget-put widget :buttons buttons))))