Function: allout-get-or-create-item-widget

allout-get-or-create-item-widget is a byte-compiled function defined in allout-widgets.el.gz.

Signature

(allout-get-or-create-item-widget &optional REDECORATE BLANK-CONTAINER)

Documentation

Return a widget for the item at point, creating the widget if necessary.

When creating a widget, we assume there has been a context change and decorate its siblings and parent, as well.

Optional BLANK-CONTAINER is for internal use, to fabricate a meta-container item with an empty body when the first proper
(non-container) item starts at the beginning of the file.

Optional REDECORATE, if non-nil, means to redecorate the widget if it already exists.

Source Code

;; Defined in /usr/src/emacs/lisp/allout-widgets.el.gz
;;;_   > allout-get-or-create-item-widget (&optional redecorate blank-container)
(defun allout-get-or-create-item-widget (&optional redecorate blank-container)
  "Return a widget for the item at point, creating the widget if necessary.

When creating a widget, we assume there has been a context change
and decorate its siblings and parent, as well.

Optional BLANK-CONTAINER is for internal use, to fabricate a
meta-container item with an empty body when the first proper
\(non-container) item starts at the beginning of the file.

Optional REDECORATE, if non-nil, means to redecorate the widget
if it already exists."
  (let ((widget (allout-get-item-widget blank-container))
        (buffer-undo-list t))
    (cond (widget (if redecorate
                      (allout-redecorate-item widget))
                  widget)
          ((or blank-container (zerop (allout-depth)))
           (or allout-container-item-widget
               (setq allout-container-item-widget
                     (allout-decorate-item-and-context
                      (widget-convert 'allout-item-widget)
                      nil blank-container))))
          ;; create a widget for a regular/non-container item:
          (t (allout-decorate-item-and-context (widget-convert
                                                'allout-item-widget))))))