From: npostavs@users.sourceforge.net
To: Peter Milliken <peter.milliken@gmail.com>
Cc: 25903@debbugs.gnu.org
Subject: bug#25903: Question re syntax tables and unexpected behaviour in C/C++ major mode
Date: Wed, 01 Mar 2017 23:49:17 -0500 [thread overview]
Message-ID: <87o9xkb7w2.fsf@users.sourceforge.net> (raw)
In-Reply-To: <CAA0nDNu4=3TrOiycS_EO_8N-JhPnz77fYhiBePB66DwVcbOkJQ@mail.gmail.com> (Peter Milliken's message of "Wed, 1 Mar 2017 09:04:05 +1100")
Peter Milliken <peter.milliken@gmail.com> writes:
> My code works fine in buffers that have Python, Ada and Lisp major
> modes but it experiences difficulties in buffers with C/C++ major
> mode. Basically, when in a C/C++ buffer, the code locates text within
> "<>" pairs as well as "{}"/"[]" pairs. I really don't want my code to
> have an (ugly) exception case where it tests "if in C/C++ mode then
> check if <> has been detected and skip over them and continue looking
> for {}/[] pairs"
You'll probably have to though. In C++, "<" matches ">" when they
denote template arguments. cc-mode implements this by adding text
properties to those characters so that they have pair syntax. Changing
the syntax table doesn't change the text properties, so for those
characters, the syntax stays the same.
Use C-u C-x = to check the syntax and properties of a particular
character.
next prev parent reply other threads:[~2017-03-02 4:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 22:04 bug#25903: Question re syntax tables and unexpected behaviour in C/C++ major mode Peter Milliken
2017-03-02 4:32 ` Glenn Morris
2017-03-02 4:49 ` npostavs [this message]
2017-03-02 20:10 ` Alan Mackenzie
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=87o9xkb7w2.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=25903@debbugs.gnu.org \
--cc=peter.milliken@gmail.com \
/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.