Variable: hs-set-up-overlay

hs-set-up-overlay is a customizable variable defined in hideshow.el.gz.

Value

ignore

Documentation

Function called with one arg, OV, a newly initialized overlay.

Hideshow puts a unique overlay on each range of text to be hidden in the buffer. Here is a simple example of how to use this variable:

  (defun display-code-line-counts (ov)
    (when (eq 'code (overlay-get ov 'hs))
      (overlay-put ov 'display
                   (format "... / %d"
                           (count-lines (overlay-start ov)
                                        (overlay-end ov))))))

  (setq hs-set-up-overlay #'display-code-line-counts)

This example shows how to get information from the overlay as well as how to set its display property. See hs-make-overlay and info node (elisp)Overlays.

This variable was added, or its default value changed, in Emacs 28.1.

Probably introduced at or before Emacs version 22.1.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/hideshow.el.gz
(defcustom hs-set-up-overlay #'ignore
  "Function called with one arg, OV, a newly initialized overlay.
Hideshow puts a unique overlay on each range of text to be hidden
in the buffer.  Here is a simple example of how to use this variable:

  (defun display-code-line-counts (ov)
    (when (eq \\='code (overlay-get ov \\='hs))
      (overlay-put ov \\='display
                   (format \"... / %d\"
                           (count-lines (overlay-start ov)
                                        (overlay-end ov))))))

  (setq hs-set-up-overlay #\\='display-code-line-counts)

This example shows how to get information from the overlay as well
as how to set its `display' property.  See `hs-make-overlay' and
info node `(elisp)Overlays'."
  :type 'function
  :version "28.1")