Function: treesit-parser-list

treesit-parser-list is a function defined in treesit.c.

Signature

(treesit-parser-list &optional BUFFER)

Documentation

Return BUFFER's parser list.

BUFFER defaults to the current buffer. If that buffer is an indirect buffer, its base buffer is used instead. That is, indirect buffers use their base buffer's parsers.

Other relevant functions are documented in the treesit group.

View in manual

Shortdoc

;; treesit
(treesit-parser-list)
    e.g. => (#<treesit-parser for c>)

Source Code

// Defined in /usr/src/emacs/src/treesit.c
{
  struct buffer *buf;
  if (NILP (buffer))
    buf = current_buffer;
  else
    {
      CHECK_BUFFER (buffer);
      buf = XBUFFER (buffer);
    }
  if (buf->base_buffer)
    buf = buf->base_buffer;

  /* Return a fresh list so messing with that list doesn't affect our
     internal data.  */
  Lisp_Object return_list = Qnil;
  Lisp_Object tail;

  tail = BVAR (buf, ts_parser_list);

  FOR_EACH_TAIL (tail)
    return_list = Fcons (XCAR (tail), return_list);

  return Freverse (return_list);
}