SMIE is meant to be a one-stop shop for structural navigation and
various other features which rely on the syntactic structure of code, in
particular automatic indentation. The main entry point is
smie-setup which is a function typically called while setting
up a major mode.
smie-setupgrammar rules-function &rest keywords
Setup SMIE navigation and indentation.
grammar is a grammar table generated by
rules-function is a set of indentation rules for use on
keywords are additional arguments, which can include the following
:forward-tokenfun: Specify the forward lexer to use.
:backward-tokenfun: Specify the backward lexer to use.
Calling this function is sufficient to make commands such as
able to properly handle structural elements other than just the paired
parentheses already handled by syntax tables. For example, if the
provided grammar is precise enough,
transpose-sexps can correctly
transpose the two arguments of a
+ operator, taking into account
the precedence rules of the language.
smie-setup is also sufficient to make TAB indentation work in
the expected way, extends blink-matching-paren to apply to
begin...end, and provides some commands that you
can bind in the major mode keymap.
This command closes the most recently opened (and not yet closed) block.
This command is like
down-list but it also pays attention to
nesting of tokens other than parentheses, such as