I'm indexing a LaTeX document using Emacs and AUCTeX and RefTeX. One thing that makes it harder to match delimiters in the document (or to spot mismatched ones) is the propensity of Emacs (or maybe AUCTeX or RefTeX—I'm not sure which is responsible) to misunderstand the |(
and |)
page range specifiers in \index
commands.
For example, when I type something like \index{ferrets|(}
, then as soon as I type the }
I get a spurious "Mismatched parentheses" warning in the minibuffer. And from this point on, all delimiter matching the document gets screwed up. For example, take the following snippet:
\somecommand{
⋮
\index{ferrets|(}
⋮
}
When I type the final }
, Emacs wrongly tells me that the matching opening brace is at \index
, not at \somecommand
.
Is there any way I can teach Emacs (or AUCTeX or RefTeX) to ignore the contents of \index
commands for the purpose of brace matching?