Function: neocaml--thing-settings

neocaml--thing-settings is a natively compiled function defined in neocaml.el.

Signature

(neocaml--thing-settings LANGUAGE)

Documentation

Return treesit-thing-settings definitions for LANGUAGE.

Configures sexp, list, sentence, text, and comment navigation.

The list thing covers delimited container nodes (parentheses, brackets, braces, arrays). On Emacs 31+, defining it causes treesit-major-mode-setup to use the hybrid treesit-forward-sexp-list for forward-sexp-function, which falls back to syntax-table matching for delimiter characters. This makes commands like delete-pair work correctly.

Source Code

;; Defined in /nix/store/ahssdx4rwzyxhyhavpn0bkznk13xrggi-emacs-packages-deps/share/emacs/site-lisp/elpa/neocaml-20260907.2015/neocaml.el
(defun neocaml--thing-settings (language)
  "Return `treesit-thing-settings' definitions for LANGUAGE.
Configures sexp, list, sentence, text, and comment navigation.

The `list' thing covers delimited container nodes (parentheses,
brackets, braces, arrays).  On Emacs 31+, defining it causes
`treesit-major-mode-setup' to use the hybrid
`treesit-forward-sexp-list' for `forward-sexp-function', which
falls back to syntax-table matching for delimiter characters.
This makes commands like `delete-pair' work correctly."
  `((,language
     (sexp (not ,(rx (or "{" "}" "(" ")" "[" "]" "[|" "|]"
                         "," "." ";" ";;" ":" "::" ":>" "->"
                         "<-" "=" "|" ".." "\"" "'"))))
     (list ,neocaml--list-node-regex)
     (sentence ,(regexp-opt '("value_definition"
                              "type_definition"
                              "exception_definition"
                              "module_definition"
                              "module_type_definition"
                              "class_definition"
                              "class_type_definition"
                              "open_module"
                              "include_module"
                              "include_module_type"
                              "external"
                              "expression_item"
                              "value_specification"
                              "method_specification"
                              "inheritance_specification"
                              "instance_variable_specification")))
     (text ,(regexp-opt '("comment" "string" "quoted_string" "character")))
     (comment "comment"))))