[LyX/master] Paragraph::needsCProtection(): use inset list

Jean-Marc Lasgouttes lasgouttes at lyx.org
Wed Dec 22 15:16:30 UTC 2021


Le 21/12/2021 à 16:32, Jürgen Spitzmüller a écrit :
> Am Dienstag, dem 21.12.2021 um 15:45 +0100 schrieb Jean-Marc
> Lasgouttes:
>> I could try to help with this, but for that I would have to
>> understand what the code does (and what cprotect does).
> 
> \cprotect allows to put verbatim context into places where this would
> normally be invalid (basically macro arguments) by outsourcing stuff to
> aux files. This fixes many shortcomings we had with things in
> footnotes, sections, and other places that simply didn't compile.
> 
> The code needs to assure at several places whether macros need to be
> \cprotect'ed (and the cprotect package loaded). This only needs to be
> checked once and only at LaTeX export. But there are several individual
> places and constellations to check for. E.g., does an inset need to be
> cprotected? Maybe only in a given context?

So it would be a bit of work to move this code to using the validate 
framework (that would set a needs_cprotect boolean property to text 
insets). I suspect that now is not the right time to do it, since it can 
wait and we do not want to destabilize current code. But this code 
definitely needs some love.

And all the explicit test of inset codes should go.

Jürgen, can you tell me what is the purpose of the test against math insets?

Do we have a cprotect torture test, BTW?

JMarc


More information about the lyx-devel mailing list