Function: hs-make-overlay

hs-make-overlay is a byte-compiled function defined in hideshow.el.gz.

Signature

(hs-make-overlay B E KIND &optional B-OFFSET E-OFFSET)

Documentation

Return a new overlay in region defined by B and E with type KIND.

KIND is either code or comment. Optional fourth arg B-OFFSET when added to B specifies the actual buffer position where the block begins. Likewise for optional fifth arg E-OFFSET. If unspecified they are taken to be 0 (zero). The following properties are set in the overlay: invisible hs hs-b-offset hs-e-offset. Also, depending on variable hs-isearch-open, the following properties may be present: isearch-open-invisible isearch-open-invisible-temporary. If variable hs-set-up-overlay is non-nil it should specify a function to call with the newly initialized overlay.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/hideshow.el.gz
(defun hs-make-overlay (b e kind &optional b-offset e-offset)
  "Return a new overlay in region defined by B and E with type KIND.
KIND is either `code' or `comment'.  Optional fourth arg B-OFFSET
when added to B specifies the actual buffer position where the block
begins.  Likewise for optional fifth arg E-OFFSET.  If unspecified
they are taken to be 0 (zero).  The following properties are set
in the overlay: `invisible' `hs' `hs-b-offset' `hs-e-offset'.  Also,
depending on variable `hs-isearch-open', the following properties may
be present: `isearch-open-invisible' `isearch-open-invisible-temporary'.
If variable `hs-set-up-overlay' is non-nil it should specify a function
to call with the newly initialized overlay."
  (unless b-offset (setq b-offset 0))
  (unless e-offset (setq e-offset 0))
  (let ((ov (make-overlay b e))
        (io (if (eq 'block hs-isearch-open)
                ;; backward compatibility -- `block'<=>`code'
                'code
              hs-isearch-open)))
    (overlay-put ov 'invisible 'hs)
    (overlay-put ov 'hs kind)
    (overlay-put ov 'hs-b-offset b-offset)
    (overlay-put ov 'hs-e-offset e-offset)
    (when (or (eq io t) (eq io kind))
      (overlay-put ov 'isearch-open-invisible 'hs-isearch-show)
      (overlay-put ov 'isearch-open-invisible-temporary
                   'hs-isearch-show-temporary))
    (when hs-set-up-overlay (funcall hs-set-up-overlay ov))
    ov))