Discussion:
[AUCTeX] Use a comment fontlock for regions between "\iffalse" and "\fi"
Hong Xu
2017-10-29 05:54:12 UTC
Permalink
Hi all,

A common trick that people use to comment out a region is using
"\iffalse" and "\fi".
How can I achieve this, and do you think it's a good idea to include
this feature in auctex?

Hong
Mosè Giordano
2017-10-29 18:22:23 UTC
Permalink
Hi Hong,
Post by Hong Xu
Hi all,
A common trick that people use to comment out a region is using
"\iffalse" and "\fi".
How can I achieve this,
Perhaps playing with `font-latex-syntactic-keywords-extra', see for
example the file style for comment package.
Post by Hong Xu
and do you think it's a good idea to include
this feature in auctex?
I think that currently AUCTeX knows nothing about conditionals in
general. I'm not sure it's worth starting from fontification of this
very particular case.

Bye,
Mosè
Hong Xu
2017-10-31 21:39:49 UTC
Permalink
Post by Mosè Giordano
Hi Hong,
Post by Hong Xu
Hi all,
A common trick that people use to comment out a region is using
"\iffalse" and "\fi".
How can I achieve this,
Perhaps playing with `font-latex-syntactic-keywords-extra', see for
example the file style for comment package.
Post by Hong Xu
and do you think it's a good idea to include
this feature in auctex?
I think that currently AUCTeX knows nothing about conditionals in
general. I'm not sure it's worth starting from fontification of this
very particular case.
Are you still interested in this :)

Hong
Mandar Mitra
2017-11-03 10:54:53 UTC
Permalink
Post by Hong Xu
Post by Mosè Giordano
Hi Hong,
Post by Hong Xu
Hi all,
A common trick that people use to comment out a region is using
"\iffalse" and "\fi".
How can I achieve this,
Perhaps playing with `font-latex-syntactic-keywords-extra', see for
example the file style for comment package.
Post by Hong Xu
and do you think it's a good idea to include
this feature in auctex?
I think that currently AUCTeX knows nothing about conditionals in
general. I'm not sure it's worth starting from fontification of this
very particular case.
Are you still interested in this :)
Sorry for butting in. I have a macros.tex file where I collect all commonly used \usepackages, \newcommands and so forth. Based on advice received via this mailing list, I inserted the following at the beginning of the file:

---------------------------------------------------------------------------
% Following workaround required in order to get auctex to parse this file
% and update auto/macros.el properly.
\iffalse
\documentclass{article}
\begin{document}
\fi
---------------------------------------------------------------------------

There's a matching \iffalse \end{document} \fi at the end of the file.

I don't know if this workaround is still required, but I suspect it will no longer work once AUCTeX starts interpreting conditionals, so I have selfish motives for hoping a little that things will remain as they are.
Loading...