unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to make `forward-sexp` handle other balanced character-pairs such as < and > or << and >> in erlang-mode or others?
@ 2021-09-27 20:53 Pierre Rouleau
  2021-09-27 21:13 ` Nikolay Kudryavtsev
  2021-09-27 21:14 ` Thibaut Verron
  0 siblings, 2 replies; 9+ messages in thread
From: Pierre Rouleau @ 2021-09-27 20:53 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

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.

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 pairs
would be done there.

I also tried to modify the syntax table the erlang-mode uses but although
it matches all sorts of
Unicode character pairs, I can't get forward-sexp to work with ?< and ?>.

Is there a variable one can use to augment or modify the behaviour of
`scan-sexp`?

Or is forward-sexp meant to be limited to lisp-like syntaxes and I have to
use another method
(like SMIE or writing my own forward-sexp-function)?

Thanks!
-- 
/Pierre


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-28 11:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-27 20:53 How to make `forward-sexp` handle other balanced character-pairs such as < and > or << and >> in erlang-mode or others? Pierre Rouleau
2021-09-27 21:13 ` Nikolay Kudryavtsev
2021-09-27 21:17   ` Pierre Rouleau
2021-09-27 21:14 ` Thibaut Verron
2021-09-27 21:22   ` Pierre Rouleau
2021-09-27 21:34     ` Thibaut Verron
2021-09-27 21:48       ` Pierre Rouleau
2021-09-28  3:45         ` Thibaut Verron
2021-09-28 11:22           ` Pierre Rouleau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).