From: Eric Frederickson <ericfrederickson68@gmail.com>
To: Jason Vas Dias <jason.vas.dias@ptt.ie>, jason.vas.dias@gmail.com
Cc: emacs-devel@gnu.org
Subject: Re: lisp-mode: how to disable parentheses matching on non-ASCII '[({]' '[})]' UTF-8 parenthesis chars ?
Date: Tue, 08 Aug 2023 12:10:13 -0500 [thread overview]
Message-ID: <87a5v1piiy.fsf@arch.mail-host-address-is-not-set> (raw)
In-Reply-To: <hhr0oenfwq.fsf@jvdspc.jvds.net>
"Jason Vas Dias"<jason.vas.dias@ptt.ie> writes:
> Good day -
>
> How to get emacs LISP program editing modes to ignore
> UTF-8 parentheses characters like '《' (\U300A) or :
> 10088 2768 (3 2) ❨ 'MEDIUM LEFT PARENTHESIS ORNAMENT'
> 10089 2769 (3 2) ❩ 'MEDIUM RIGHT PARENTHESIS ORNAMENT'
> 10090 276A (3 2) ❪ 'MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT'
> 10091 276B (3 2) ❫ 'MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT'
> 10222 27EE (5 1) ⟮ 'MATHEMATICAL LEFT FLATTENED PARENTHESIS'
> 10223 27EF (5 1) ⟯ 'MATHEMATICAL RIGHT FLATTENED PARENTHESIS'
> 10629 2985 (3 2) ⦅ 'LEFT WHITE PARENTHESIS'
> 10630 2986 (3 2) ⦆ 'RIGHT WHITE PARENTHESIS'
> 11816 2E28 (5 1) ⸨ 'LEFT DOUBLE PARENTHESIS'
> 11817 2E29 (5 1) ⸩ 'RIGHT DOUBLE PARENTHESIS'
> 64830 FD3E (1 1) ﴾ 'ORNATE LEFT PARENTHESIS'
> 64831 FD3F (1 1) ﴿ 'ORNATE RIGHT PARENTHESIS'
> 12298 300A (1 1) 《 'LEFT DOUBLE ANGLE BRACKET'
> 12299 300B (1 1) 》 'RIGHT DOUBLE ANGLE BRACKET'
> 65113 FE59 (1 1) ﹙ 'SMALL LEFT PARENTHESIS'
> 65114 FE5A (1 1) ﹚ 'SMALL RIGHT PARENTHESIS'
> 65288 FF08 (1 1) ( 'FULLWIDTH LEFT PARENTHESIS'
> 65289 FF09 (1 1) ) 'FULLWIDTH RIGHT PARENTHESIS'
> 65375 FF5F (3 2) ⦅ 'FULLWIDTH LEFT WHITE PARENTHESIS'
> 65376 FF60 (3 2) ⦆ 'FULLWIDTH RIGHT WHITE PARENTHESIS'
Your problem (although I'm assuming this wouldn't be a problem for most users)
is that all the above characters are defined to be opening/closing delimiters in the
syntax table for elisp-mode. (You can view the syntax table for the current
major mode with "C-h s").
In order to disable their treatment as opening or closing delimiters, use the
modify-syntax-entry funtion as described above on this thread. For instance:
(modify-syntax-entry ?❨ "w")
to put MEDIUM-LEFT-PARENTHESIS-ORNAMENT in the word class instead of the
opening-delimeter class. Doing this for all the characters you specified will
give you your desired behavior. See this section of the Emacs wiki:
https://www.emacswiki.org/emacs/EmacsSyntaxTable#h5o-4
for information on how to put these types configurations in your init file so
that they will be in effect every time you enter elisp-mode.
Best,
Eric Frederickson
> Please could some emacs guru let me know how the 'lisp-mode' based source
> editing modes can be made to ignore / treat as normal characters such not-ascii-'(' and
> not-ascii-')' characters and to NOT attempt to balance them or to
> consider them parenthesis syntax ? No LISP parser I am using
> considers them to be syntax.
>
> It is really annoying to have to turn all parenthesis balancing off
> when my lisp source code files might contain such valid unicode characters.
>
> I am running Emacs 28.2 I built as RPM with modified Fedora emacs
> spec file under Fedora Linux v36 x86_64 .
>
> Thanks & Best Regards,
> Jason
prev parent reply other threads:[~2023-08-08 17:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 7:37 lisp-mode: how to disable parentheses matching on non-ASCII '[({]' '[})]' UTF-8 parenthesis chars ? Jason Vas Dias
2023-08-08 9:19 ` Eric S Fraga
2023-08-08 17:23 ` Jason Vas Dias
2023-08-08 12:10 ` Eli Zaretskii
2023-08-08 17:10 ` Eric Frederickson [this message]
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=87a5v1piiy.fsf@arch.mail-host-address-is-not-set \
--to=ericfrederickson68@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=jason.vas.dias@gmail.com \
--cc=jason.vas.dias@ptt.ie \
/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.