I am trying to find an easy and efficient way to modify the behaviour of forward-sexp
to handle balanced pairs of characters not normally supported by it, such as balanced <
and >
and balanced <<
and >>
.
My specific case is to enhance the support of Erlang but I believe it could apply to a lot of scenarios.
The implementation of forward-sexp
allows the use of a forward-sexp-function
which means I could implement such a function. I am also aware of the SMIE library and will look into it.
However I was hoping to find a variable that the C-implemented scan-sexp
could use to define the matching pair but have not succeeded so far. It would seem the easiest and most efficient way of implementing such handling of balanced pair would be done there.
Is there a variable one can use to augment or modify the behaviour of scan-sexp
?