Function: widget-add-documentation-string-button
widget-add-documentation-string-button is a byte-compiled function
defined in wid-edit.el.gz.
Signature
(widget-add-documentation-string-button WIDGET &rest ARGS)
Documentation
Insert a new documentation-string widget based on WIDGET.
The new widget becomes a child of WIDGET, and is also added to
its :buttons list. The documentation string is found from
WIDGET using the function widget-docstring.
Optional ARGS specifies additional keyword arguments for the
documentation-string widget.
Source Code
;; Defined in /usr/src/emacs/lisp/wid-edit.el.gz
(defun widget-add-documentation-string-button (widget &rest args)
"Insert a new `documentation-string' widget based on WIDGET.
The new widget becomes a child of WIDGET, and is also added to
its `:buttons' list. The documentation string is found from
WIDGET using the function `widget-docstring'.
Optional ARGS specifies additional keyword arguments for the
`documentation-string' widget."
(let ((doc (widget-docstring widget))
(indent (widget-get widget :indent))
(doc-indent (widget-get widget :documentation-indent)))
(when doc
(and (eq (preceding-char) ?\n)
indent
(insert-char ?\s indent))
(unless (or (numberp doc-indent) (null doc-indent))
(setq doc-indent 0))
(widget-put widget :buttons
(cons (apply 'widget-create-child-and-convert
widget 'documentation-string
:indent doc-indent
(nconc args (list doc)))
(widget-get widget :buttons))))))