Function: treesit-grammar-location

treesit-grammar-location is a function defined in treesit.c.

Signature

(treesit-grammar-location LANGUAGE)

Documentation

Return the absolute file name of the grammar file for LANGUAGE.

If LANGUAGE isn't loaded yet, load it first. If the language can't be loaded or the file name couldn't be determined, return nil.

Other relevant functions are documented in the treesit group.

Shortdoc

;; treesit
(treesit-language-abi-version 'c)

Source Code

// Defined in /usr/src/emacs/src/treesit.c
{
  CHECK_SYMBOL (language);

  Lisp_Object signal_symbol = Qnil;
  Lisp_Object signal_data = Qnil;
  struct treesit_loaded_lang lang
    = treesit_load_language (language, &signal_symbol, &signal_data);

  if (!lang.lang || !lang.filename) return Qnil;

  return DECODE_FILE (make_unibyte_string (lang.filename,
					   strlen (lang.filename)));
}