Le 01/02/2010 14:27, Vincent van Ravesteijn - TNW a écrit :
More important, I'm still not sure why we forbid the REGEXP_MODE in ERTs. Why does LyX crash ? Why is this only happening for ERTs ? Aren't there any other insets which can crash for the same reason ? Why wouldn't it be possible to search for a regular expression in an ERT ? Does it even make sense to have an ERT in the search field ?
ERT is built around the assumption that it does not contain insets. This may be unfortunate, but we have to be careful.
I know the bug reported a crash when inserting a regexp in ERT, but the solution is then not to disallow the regexp mode in ERT. That's solving the symptom in stead of the cause. I say this because with a little experimenting I see that LyX also crashes for URLs and Program Listings. They all three have set "PassThru true" in lib/stdinsets.inc.
I have started a patch to remove all explicit references to ERT_CODE in the code base. Unfortunately I ran out of time, but we have to replace all of these to calls to pass_thru or free_spacing (both at insetlayout and paragraph layout level), and clarify what is the effect of these properties.
Finally, for the implementation right now, I propose to mimick what is done for the various LFUN_xxx_INSERT and use the "code" helper variable.
JMarc JMarc