Function: evil-ex-make-hl

evil-ex-make-hl is a byte-compiled function defined in evil-search.el.

Signature

(evil-ex-make-hl NAME &key (FACE 'evil-ex-lazy-highlight) (WIN (selected-window)) MIN MAX MATCH-HOOK UPDATE-HOOK)

Documentation

Create a new highlight object with name NAME and properties ARGS.

The following properties are supported:
:face The face to be used for the highlighting overlays.
:win The window in which the highlighting should be shown.
     Note that the highlight will be visible in all windows showing
     the corresponding buffer, but only the matches visible in the
     specified window will actually be highlighted. If :win is nil,
     the matches in all windows will be highlighted.
:min The minimal buffer position for highlighted matches.
:max The maximal buffer position for highlighted matches.
:match-hook A hook to be called once for each highlight.
            The hook must take two arguments, the highlight and
            the overlay for that highlight.
:update-hook A hook called once after updating the highlighting
             with two arguments, the highlight and a message string
             describing the current match status.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-search.el
(cl-defun evil-ex-make-hl
    (name &key (face 'evil-ex-lazy-highlight) (win (selected-window))
          min max match-hook update-hook)
  "Create a new highlight object with name NAME and properties ARGS.
The following properties are supported:
:face The face to be used for the highlighting overlays.
:win The window in which the highlighting should be shown.
     Note that the highlight will be visible in all windows showing
     the corresponding buffer, but only the matches visible in the
     specified window will actually be highlighted. If :win is nil,
     the matches in all windows will be highlighted.
:min The minimal buffer position for highlighted matches.
:max The maximal buffer position for highlighted matches.
:match-hook A hook to be called once for each highlight.
            The hook must take two arguments, the highlight and
            the overlay for that highlight.
:update-hook A hook called once after updating the highlighting
             with two arguments, the highlight and a message string
             describing the current match status."
  (unless (symbolp name)
    (user-error "Expected symbol as name of highlight"))
  (when (assq name evil-ex-active-highlights-alist)
    (evil-ex-delete-hl name))
  (unless evil-ex-active-highlights-alist
    (add-hook 'window-scroll-functions
              #'evil-ex-hl-update-highlights-scroll nil t)
    (add-hook 'window-size-change-functions
              #'evil-ex-hl-update-highlights-resize nil))
  (push (cons name (vector name
                           nil
                           face
                           win
                           min max
                           match-hook update-hook
                           nil))
        evil-ex-active-highlights-alist))