Function: allout-item-span

allout-item-span is a byte-compiled function defined in allout-widgets.el.gz.

Signature

(allout-item-span ITEM-WIDGET &optional START END)

Documentation

Return or register the location of an ITEM-WIDGET's actual START and END.

If START and END are not passed in, return either a dotted pair of the current span, if established, or nil if not yet set.

When the START and END are passed, return the distance that the start of the item moved. We return 0 if the span was not previously established or is not moved.

Source Code

;; Defined in /usr/src/emacs/lisp/allout-widgets.el.gz
;;;_  : Item decoration support
;;;_   > allout-item-span (item-widget &optional start end)
(defun allout-item-span (item-widget &optional start end)
  "Return or register the location of an ITEM-WIDGET's actual START and END.

If START and END are not passed in, return either a dotted pair
of the current span, if established, or nil if not yet set.

When the START and END are passed, return the distance that the
start of the item moved.  We return 0 if the span was not
previously established or is not moved."
  (let ((overlay (widget-get item-widget :span-overlay)))
    (cond ((not overlay) (when start
                           (setq overlay (make-overlay start end nil t nil))
                           (overlay-put overlay 'button item-widget)
                           (overlay-put overlay 'evaporate t)
                           (widget-put item-widget :span-overlay overlay)
                           t))
          ;; report:
          ((not start) (cons (overlay-start overlay) (overlay-end overlay)))
          ;; move:
          ((or (not (equal (overlay-start overlay) start))
               (not (equal (overlay-end overlay) end)))
           (move-overlay overlay start end)
           t)
          ;; specified span already set:
          (t nil))))