Oleh <[email protected]> writes:
Hi Oleh,
> I've added the generalization to anything that starts with "\if".
> Should be fine unless people use something like:
>
> \newcommand\iffy{...}
>
> See the attached patch.
No, that's too lax. In one of my documents I actually do have an \iface
macro which has nothing to with "if".
What I basically had in mind was having two variables
`TeX-begin-macro-list' and `TeX-end-macro-list'. From those begin/end
regexes could be created using `regexp-opt' and used analogously to
`LaTeX-begin-regexp'/`LaTeX-end-regexp'.
This has the benefit that a hypothetical ifplatform.el style simply can
add \ifwindows and friends to the `TeX-begin-macro-list' and indentation
should just work.
By default, `TeX-begin-macro-list' should contain all the standard TeX
if variations: if, ifx, ifnum, ifodd, ifdim, iftrue, iffalse, .... Then
the begin regex would be computed by (concat "\\\\" (regexp-opt
TeX-begin-macro-list) "\\b"). Note that "\\\\if\\b" also matches
"\if@toggle" solving your original issue.
Likewise, `TeX-end-macro-list' would contain "else" and "fi".
Does that make sense?
Bye,
Tassilo
_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex