bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25903: Question re syntax tables and unexpected behaviour in C/C++ m


From: npostavs
Subject: bug#25903: Question re syntax tables and unexpected behaviour in C/C++ major mode
Date: Wed, 01 Mar 2017 23:49:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]