Function: treesit-parser-add-notifier

treesit-parser-add-notifier is a function defined in treesit.c.

Signature

(treesit-parser-add-notifier PARSER FUNCTION)

Documentation

Add FUNCTION to the list of PARSER's after-change notifiers.

FUNCTION must be a function symbol, rather than a lambda form. FUNCTION should take 2 arguments, RANGES and PARSER. RANGES is a list of cons cells of the form (START . END), where START and END are buffer positions. PARSER is the parser issuing the notification.

Other relevant functions are documented in the treesit group.

View in manual

Shortdoc

;; treesit

Source Code

// Defined in /usr/src/emacs/src/treesit.c
{
  treesit_check_parser (parser);
  /* For simplicity we don't accept lambda functions.  */
  CHECK_SYMBOL (function);

  Lisp_Object functions = XTS_PARSER (parser)->after_change_functions;
  if (NILP (Fmemq (function, functions)))
    XTS_PARSER (parser)->after_change_functions = Fcons (function, functions);
  return Qnil;
}