Re: [LyX/master] Add basic support for cprotect

2018-04-30 Thread Jürgen Spitzmüller
Am Sonntag, den 29.04.2018, 12:59 -0400 schrieb Scott Kostyshak: > Seems to work very well in a lot of testing I just did. Many thanks for doing this. > I've done some testing of weird situations (e.g. a box containing a > greyed out inset, and putting all of that inside another box and > putting

Re: [LyX/master] Add basic support for cprotect

2018-04-29 Thread Scott Kostyshak
On Sun, Apr 29, 2018 at 08:25:53AM +, Jürgen Spitzmüller wrote: > Am Dienstag, den 24.04.2018, 12:27 -0400 schrieb Scott Kostyshak: > > > It's more complicated. You need to pass down runparams.need_protect > > > to the > > > diverse cprotect methods. I'll have a look if I find some time. > > >

Re: [LyX/master] Add basic support for cprotect

2018-04-29 Thread Jürgen Spitzmüller
Am Dienstag, den 24.04.2018, 12:27 -0400 schrieb Scott Kostyshak: > > It's more complicated. You need to pass down runparams.need_protect > > to the > > diverse cprotect methods. I'll have a look if I find some time. > > OK sounds good. Here's a patch for you to try. This works for me for boxes,

Re: [LyX/master] Add basic support for cprotect

2018-04-24 Thread Scott Kostyshak
On Tue, Apr 24, 2018 at 07:09:55AM +, Jürgen Spitzmüller wrote: > 2018-04-24 3:55 GMT+02:00 Scott Kostyshak : > > > I tried the attached patch, but it did not help with the attached .lyx > > example files. > > > > It's more complicated. You need to pass down runparams.need_protect to the > di

Re: [LyX/master] Add basic support for cprotect

2018-04-24 Thread Jürgen Spitzmüller
2018-04-24 3:55 GMT+02:00 Scott Kostyshak : > I tried the attached patch, but it did not help with the attached .lyx > example files. > It's more complicated. You need to pass down runparams.need_protect to the diverse cprotect methods. I'll have a look if I find some time. Jürgen

Re: [LyX/master] Add basic support for cprotect

2018-04-23 Thread Scott Kostyshak
On Tue, Apr 24, 2018 at 01:55:31AM +, Scott Kostyshak wrote: > On Mon, Apr 23, 2018 at 02:56:53PM +, Jürgen Spitzmüller wrote: > > 2018-04-23 16:38 GMT+02:00 Scott Kostyshak : > > > > > That could be. I really don't know. Is there a LyX method to check if > > > the context is fragile? Or s

Re: [LyX/master] Add basic support for cprotect

2018-04-23 Thread Scott Kostyshak
On Mon, Apr 23, 2018 at 02:56:53PM +, Jürgen Spitzmüller wrote: > 2018-04-23 16:38 GMT+02:00 Scott Kostyshak : > > > That could be. I really don't know. Is there a LyX method to check if > > the context is fragile? Or should I hardcode the names of the > > environments that seem to need it (fr

Re: [LyX/master] Add basic support for cprotect

2018-04-23 Thread Jürgen Spitzmüller
2018-04-23 16:38 GMT+02:00 Scott Kostyshak : > That could be. I really don't know. Is there a LyX method to check if > the context is fragile? Or should I hardcode the names of the > environments that seem to need it (from testing)? > The NeedProtect flag of layouts. > > Alternatively, I'm also

Re: [LyX/master] Add basic support for cprotect

2018-04-23 Thread Jürgen Spitzmüller
2018-04-23 16:38 GMT+02:00 Scott Kostyshak : > I misunderstood the comment > >// Environments and "no latex" types (e.g., knitr chunks) >// need cprotection regardless the content > > Reading it again, it was my mistake to interpret it as "every command > including an environment should be

Re: [LyX/master] Add basic support for cprotect

2018-04-23 Thread Scott Kostyshak
On Mon, Apr 23, 2018 at 08:19:12AM +, Jürgen Spitzmüller wrote: > Am Montag, den 23.04.2018, 09:30 +0200 schrieb Jürgen Spitzmüller: > > AFAIU this would simply overshoot the cprotecting. It would cprotect > > each single command that has an environment in its argument, but > > AFAIU > > only s

Re: [LyX/master] Add basic support for cprotect

2018-04-23 Thread Scott Kostyshak
On Mon, Apr 23, 2018 at 07:30:01AM +, Jürgen Spitzmüller wrote: > Am Sonntag, den 22.04.2018, 15:48 -0400 schrieb Scott Kostyshak: > > Could you please give an example (e.g. steps to reproduce a problem > > with the patch)? > > AFAIU this would simply overshoot the cprotecting. It would cprote

Re: [LyX/master] Add basic support for cprotect

2018-04-23 Thread Jürgen Spitzmüller
Am Montag, den 23.04.2018, 09:30 +0200 schrieb Jürgen Spitzmüller: > AFAIU this would simply overshoot the cprotecting. It would cprotect > each single command that has an environment in its argument, but > AFAIU > only some commands need the cprotecting (I suppose those who are not > \long). With

Re: [LyX/master] Add basic support for cprotect

2018-04-23 Thread Jürgen Spitzmüller
Am Sonntag, den 22.04.2018, 15:48 -0400 schrieb Scott Kostyshak: > Could you please give an example (e.g. steps to reproduce a problem > with the patch)? AFAIU this would simply overshoot the cprotecting. It would cprotect each single command that has an environment in its argument, but AFAIU only

Re: [LyX/master] Add basic support for cprotect

2018-04-22 Thread Scott Kostyshak
On Sun, Apr 22, 2018 at 05:57:15PM +, Jürgen Spitzmüller wrote: > Am Sonntag, den 22.04.2018, 13:23 -0400 schrieb Scott Kostyshak: > > What is the !getLayout().needsCProtect() check for? Does it need to > > go > > before the environment check, or is the attached patch OK? > > This looks wrong.

Re: [LyX/master] Add basic support for cprotect

2018-04-22 Thread Jürgen Spitzmüller
Am Sonntag, den 22.04.2018, 13:23 -0400 schrieb Scott Kostyshak: > What is the !getLayout().needsCProtect() check for? Does it need to > go > before the environment check, or is the attached patch OK? This looks wrong. This would mean that any command would be cprotected, notwithstanding the conte

Re: [LyX/master] Add basic support for cprotect

2018-04-22 Thread Scott Kostyshak
On Fri, Apr 13, 2018 at 03:53:28PM +, Juergen Spitzmueller wrote: > +bool InsetText::needsCProtection() const > +{ > + if (!getLayout().needsCProtect()) > + return false; > + > + // Environments need cprotection regardless the content > + if (getLayout().latextype() ==

Re: [LyX/master] Add basic support for cprotect

2018-04-19 Thread Scott Kostyshak
On Thu, Apr 19, 2018 at 06:49:31AM +, Jürgen Spitzmüller wrote: > Am Mittwoch, den 18.04.2018, 15:19 -0400 schrieb Scott Kostyshak: > > Any objection to put this patch in? > > None from me. Thanks for investigating. Pushed to master at 80fe0dbe. Scott signature.asc Description: PGP signat

Re: [LyX/master] Add basic support for cprotect

2018-04-18 Thread Jürgen Spitzmüller
Am Mittwoch, den 18.04.2018, 15:19 -0400 schrieb Scott Kostyshak: > On Mon, Apr 16, 2018 at 04:03:44PM +, Scott Kostyshak wrote: > > > I see. Thanks for the explanation. OK I will test whether they are > > needed with the example I gave or with the knitr example file. If > > it is > > not need

Re: [LyX/master] Add basic support for cprotect

2018-04-18 Thread Scott Kostyshak
On Mon, Apr 16, 2018 at 04:03:44PM +, Scott Kostyshak wrote: > I see. Thanks for the explanation. OK I will test whether they are > needed with the example I gave or with the knitr example file. If it is > not needed for both, I will remove it for that type of box. Let me know > if there is an

Re: [LyX/master] Add basic support for cprotect

2018-04-16 Thread Scott Kostyshak
On Mon, Apr 16, 2018 at 03:52:38PM +, Jürgen Spitzmüller wrote: > 2018-04-16 17:43 GMT+02:00 Scott Kostyshak : > > > I don't mind doing it, but do you agree that it should be done? > > > > If we are certain about it. > > > > I have no knowledge of \cprotect, so I don't know if e.g. in the c

Re: [LyX/master] Add basic support for cprotect

2018-04-16 Thread Jürgen Spitzmüller
2018-04-16 17:43 GMT+02:00 Scott Kostyshak : > I don't mind doing it, but do you agree that it should be done? > If we are certain about it. > I have no knowledge of \cprotect, so I don't know if e.g. in the case of > double frame, although it is not needed for the example file I provided, > pe

Re: [LyX/master] Add basic support for cprotect

2018-04-16 Thread Scott Kostyshak
On Mon, Apr 16, 2018 at 07:56:15AM +, Jürgen Spitzmüller wrote: > Am Sonntag, den 15.04.2018, 13:47 -0400 schrieb Scott Kostyshak: > > I see. So in this case should we remove \cprotect for situations that > > don't need it? > > Feel free to do that. I don't mind doing it, but do you agree tha

Re: [LyX/master] Add basic support for cprotect

2018-04-16 Thread Jürgen Spitzmüller
Am Sonntag, den 15.04.2018, 13:47 -0400 schrieb Scott Kostyshak: > I see. So in this case should we remove \cprotect for situations that > don't need it? Feel free to do that. Jürgen > > Scott signature.asc Description: This is a digitally signed message part

Re: [LyX/master] Add basic support for cprotect

2018-04-15 Thread Scott Kostyshak
On Sun, Apr 15, 2018 at 04:18:11PM +, Jürgen Spitzmüller wrote: > Am Sonntag, den 15.04.2018, 10:45 -0400 schrieb Scott Kostyshak: > > I think I was unclear. I mean that before your commit, if you put a > > box > > around a verbatim, it worked unless the box was a "simple frame". To > > see > >

Re: [LyX/master] Add basic support for cprotect

2018-04-15 Thread Jürgen Spitzmüller
Am Sonntag, den 15.04.2018, 10:45 -0400 schrieb Scott Kostyshak: > I think I was unclear. I mean that before your commit, if you put a > box > around a verbatim, it worked unless the box was a "simple frame". To > see > this, open the file simpleFrame_verbatim.lyx that I sent before with > e.g. LyX

Re: [LyX/master] Add basic support for cprotect

2018-04-15 Thread Scott Kostyshak
On Sun, Apr 15, 2018 at 10:35:32AM +, Jürgen Spitzmüller wrote: > Am Samstag, den 14.04.2018, 13:15 -0400 schrieb Scott Kostyshak: > > Did we need to add \cprotect also for the other box modes? For the > > example file, all of the options besides simple frame compiled > > without > > error. Was

Re: [LyX/master] Add basic support for cprotect

2018-04-15 Thread Jürgen Spitzmüller
Am Samstag, den 14.04.2018, 13:15 -0400 schrieb Scott Kostyshak: > Did we need to add \cprotect also for the other box modes? For the > example file, all of the options besides simple frame compiled > without > error. Was that just by luck? No, because I added the calls. Since the Box latex routin

Re: [LyX/master] Add basic support for cprotect

2018-04-14 Thread Scott Kostyshak
On Sat, Apr 14, 2018 at 11:01:04AM +, Jürgen Spitzmüller wrote: > Am Freitag, den 13.04.2018, 22:18 -0400 schrieb Scott Kostyshak: > > Can we add support for a verbatim inside a simple frame? See the > > attached, simpleFrame_verbatim.lyx. > > Done. Note that not all cases work (for instance,

Re: [LyX/master] Add basic support for cprotect

2018-04-14 Thread Jürgen Spitzmüller
Am Freitag, den 13.04.2018, 22:18 -0400 schrieb Scott Kostyshak: > Can we add support for a verbatim inside a simple frame? See the > attached, simpleFrame_verbatim.lyx. Done. Note that not all cases work (for instance, I don't know how to \cprotect a parbox). > This issue also affects putting a

Re: [LyX/master] Add basic support for cprotect

2018-04-13 Thread Scott Kostyshak
On Fri, Apr 13, 2018 at 03:53:28PM +, Juergen Spitzmueller wrote: > Note that the implementation is still rather basic and might need > extension for other cases. Can we add support for a verbatim inside a simple frame? See the attached, simpleFrame_verbatim.lyx. Also see the attache