From: Pierre Rouleau <prouleau001@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: How to make `forward-sexp` handle other balanced character-pairs such as < and > or << and >> in erlang-mode or others?
Date: Mon, 27 Sep 2021 16:53:49 -0400 [thread overview]
Message-ID: <CALTqLibO4uVMmP704+SkkrCdxnbbFw9bkfG0en2D9NtwccpA=A@mail.gmail.com> (raw)
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
next reply other threads:[~2021-09-27 20:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 20:53 Pierre Rouleau [this message]
2021-09-27 21:13 ` How to make `forward-sexp` handle other balanced character-pairs such as < and > or << and >> in erlang-mode or others? 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALTqLibO4uVMmP704+SkkrCdxnbbFw9bkfG0en2D9NtwccpA=A@mail.gmail.com' \
--to=prouleau001@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.