Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-11 Thread Andrew Parsloe


On 11/07/2016 2:00 a.m., Guillaume Munch wrote:

Le 10/07/2016 14:56, Richard Heck a écrit :

On 07/10/2016 09:53 AM, Guillaume Munch wrote:

Le 10/07/2016 14:48, Richard Heck a écrit :

On 07/10/2016 05:26 AM, Andrew Parsloe wrote:


I ask in near total ignorance, but "my ears pricked up" when I read
"EXPORT_in_THREAD" and "It's set in the code, but can be manually
unset by people who don't want the risks of background export,
threading, etc." Is this a way to tackle
http://www.lyx.org/trac/ticket/8346 on the problems threaded export
poses for command-sequences?


Not really, unless you just want to disable background export entirely.
The switch has to be set compile time.


This is not essential, it is trivial to make it run-time (but is it
really worth an interface?).


Check the bug Andrew mentioned for one reason it would be good to have
this.
Basically, if you do something like:

 command-sequence buffer-export someformat; buffer-reload

in an attempt to process something externally, it fails, because the
reload happens
before the export completes. I.e., it happens almost instantly.



A global switch does not strike me as an ideal solution for this problem.

Not ideal maybe, but command-sequences by their very nature seem 
somewhat hackish. Being able to attach a shortcut key to something like


command-sequence turn-off-threaded-export; buffer-export; buffer-reload; 
turn-on-threaded-export


would be an advance on the present situation and no more hackish to my 
mind than any number of other command-sequences that I currently use 
(including command-sequence buffer-zoom-in; buffer-zoom-out suggested on 
the user's list not so long ago to regenerate previews).


Andrew

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Richard Heck
On 07/10/2016 10:02 AM, Guillaume Munch wrote:
> Le 10/07/2016 14:47, Richard Heck a écrit :
>> On 07/10/2016 07:06 AM, Guillaume Munch wrote:
>>> Le 10/07/2016 06:42, Richard Heck a écrit :
 On 07/10/2016 01:33 AM, Scott Kostyshak wrote:
> On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:
>> commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
>> Author: Richard Heck 
>> Date:   Sun Jul 10 01:12:42 2016 -0400
>>
>>   Fix thinko in Buffer::preview. It is possible for this
>> routine to
>>   be called when we do not have a cloned Buffer, namely, if we
>> do not
>>   have EXPORT_in_THREAD defined.
> Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
> this could be useful for debugging purposes (e.g ruling out that a
> bug
> is due to exporting in a separate thread).

 It's #defined in GuiView.cpp and GuiAlert.cpp. It's set in the
 code, but
 can be manually unset by people who don't want the risks of background
 export, threading, etc. And yes, it is useful for the purpose you
 mentioned.

>>>
>>> Note that one of the file erroneously tests with #ifdef instead of #if,
>>> so I doubt that it has ever been unset. (This is fixed by my patch at
>>> .)
>>
>> I noticed that, too. Certainly that can be fixed independently of the
>> rest (which
>> is fine by me, too).
>>
>
> Yes, but better wait to see if my patch is meant to be committed soon.

Patches like this one are very often committed to master early in the
release
cycle. Unless someone has some objection, I'd say go ahead.

Richard




Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Guillaume Munch

Le 10/07/2016 14:47, Richard Heck a écrit :

On 07/10/2016 07:06 AM, Guillaume Munch wrote:

Le 10/07/2016 06:42, Richard Heck a écrit :

On 07/10/2016 01:33 AM, Scott Kostyshak wrote:

On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:

commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
Author: Richard Heck 
Date:   Sun Jul 10 01:12:42 2016 -0400

  Fix thinko in Buffer::preview. It is possible for this routine to
  be called when we do not have a cloned Buffer, namely, if we
do not
  have EXPORT_in_THREAD defined.

Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
this could be useful for debugging purposes (e.g ruling out that a bug
is due to exporting in a separate thread).


It's #defined in GuiView.cpp and GuiAlert.cpp. It's set in the code, but
can be manually unset by people who don't want the risks of background
export, threading, etc. And yes, it is useful for the purpose you
mentioned.



Note that one of the file erroneously tests with #ifdef instead of #if,
so I doubt that it has ever been unset. (This is fixed by my patch at
.)


I noticed that, too. Certainly that can be fixed independently of the
rest (which
is fine by me, too).



Yes, but better wait to see if my patch is meant to be committed soon.



Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Guillaume Munch

Le 10/07/2016 14:56, Richard Heck a écrit :

On 07/10/2016 09:53 AM, Guillaume Munch wrote:

Le 10/07/2016 14:48, Richard Heck a écrit :

On 07/10/2016 05:26 AM, Andrew Parsloe wrote:


I ask in near total ignorance, but "my ears pricked up" when I read
"EXPORT_in_THREAD" and "It's set in the code, but can be manually
unset by people who don't want the risks of background export,
threading, etc." Is this a way to tackle
http://www.lyx.org/trac/ticket/8346 on the problems threaded export
poses for command-sequences?


Not really, unless you just want to disable background export entirely.
The switch has to be set compile time.


This is not essential, it is trivial to make it run-time (but is it
really worth an interface?).


Check the bug Andrew mentioned for one reason it would be good to have this.
Basically, if you do something like:

 command-sequence buffer-export someformat; buffer-reload

in an attempt to process something externally, it fails, because the
reload happens
before the export completes. I.e., it happens almost instantly.



A global switch does not strike me as an ideal solution for this problem.




Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Richard Heck
On 07/10/2016 09:53 AM, Guillaume Munch wrote:
> Le 10/07/2016 14:48, Richard Heck a écrit :
>> On 07/10/2016 05:26 AM, Andrew Parsloe wrote:
>>>
>>> I ask in near total ignorance, but "my ears pricked up" when I read
>>> "EXPORT_in_THREAD" and "It's set in the code, but can be manually
>>> unset by people who don't want the risks of background export,
>>> threading, etc." Is this a way to tackle
>>> http://www.lyx.org/trac/ticket/8346 on the problems threaded export
>>> poses for command-sequences?
>>
>> Not really, unless you just want to disable background export entirely.
>> The switch has to be set compile time.
>
> This is not essential, it is trivial to make it run-time (but is it
> really worth an interface?).

Check the bug Andrew mentioned for one reason it would be good to have this.
Basically, if you do something like:

command-sequence buffer-export someformat; buffer-reload

in an attempt to process something externally, it fails, because the
reload happens
before the export completes. I.e., it happens almost instantly.

Richard



Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Guillaume Munch

Le 10/07/2016 14:48, Richard Heck a écrit :

On 07/10/2016 05:26 AM, Andrew Parsloe wrote:


I ask in near total ignorance, but "my ears pricked up" when I read
"EXPORT_in_THREAD" and "It's set in the code, but can be manually
unset by people who don't want the risks of background export,
threading, etc." Is this a way to tackle
http://www.lyx.org/trac/ticket/8346 on the problems threaded export
poses for command-sequences?


Not really, unless you just want to disable background export entirely.
The switch has to be set compile time.


This is not essential, it is trivial to make it run-time (but is it 
really worth an interface?).




Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Richard Heck
On 07/10/2016 05:26 AM, Andrew Parsloe wrote:
>
>
> On 10/07/2016 5:42 p.m., Richard Heck wrote:
>> On 07/10/2016 01:33 AM, Scott Kostyshak wrote:
>>> On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:
 commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
 Author: Richard Heck 
 Date:   Sun Jul 10 01:12:42 2016 -0400

  Fix thinko in Buffer::preview. It is possible for this routine to
  be called when we do not have a cloned Buffer, namely, if we
 do not
  have EXPORT_in_THREAD defined.
>>> Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
>>> this could be useful for debugging purposes (e.g ruling out that a bug
>>> is due to exporting in a separate thread).
>>
>> It's #defined in GuiView.cpp and GuiAlert.cpp. It's set in the code, but
>> can be manually unset by people who don't want the risks of background
>> export, threading, etc. And yes, it is useful for the purpose you
>> mentioned.
>>
>> Probably, it should be exposed via configure, etc, but no one ever
>> did that.
>>
>> Richard
>>
>
> I ask in near total ignorance, but "my ears pricked up" when I read
> "EXPORT_in_THREAD" and "It's set in the code, but can be manually
> unset by people who don't want the risks of background export,
> threading, etc." Is this a way to tackle
> http://www.lyx.org/trac/ticket/8346 on the problems threaded export
> poses for command-sequences?

Not really, unless you just want to disable background export entirely.
The switch has to be set compile time.

Richard



Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Richard Heck
On 07/10/2016 07:06 AM, Guillaume Munch wrote:
> Le 10/07/2016 06:42, Richard Heck a écrit :
>> On 07/10/2016 01:33 AM, Scott Kostyshak wrote:
>>> On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:
 commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
 Author: Richard Heck 
 Date:   Sun Jul 10 01:12:42 2016 -0400

  Fix thinko in Buffer::preview. It is possible for this routine to
  be called when we do not have a cloned Buffer, namely, if we
 do not
  have EXPORT_in_THREAD defined.
>>> Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
>>> this could be useful for debugging purposes (e.g ruling out that a bug
>>> is due to exporting in a separate thread).
>>
>> It's #defined in GuiView.cpp and GuiAlert.cpp. It's set in the code, but
>> can be manually unset by people who don't want the risks of background
>> export, threading, etc. And yes, it is useful for the purpose you
>> mentioned.
>>
>
> Note that one of the file erroneously tests with #ifdef instead of #if,
> so I doubt that it has ever been unset. (This is fixed by my patch at
> .)

I noticed that, too. Certainly that can be fixed independently of the
rest (which
is fine by me, too).

Richard



Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Guillaume Munch

Le 10/07/2016 06:42, Richard Heck a écrit :

On 07/10/2016 01:33 AM, Scott Kostyshak wrote:

On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:

commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
Author: Richard Heck 
Date:   Sun Jul 10 01:12:42 2016 -0400

 Fix thinko in Buffer::preview. It is possible for this routine to
 be called when we do not have a cloned Buffer, namely, if we do not
 have EXPORT_in_THREAD defined.

Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
this could be useful for debugging purposes (e.g ruling out that a bug
is due to exporting in a separate thread).


It's #defined in GuiView.cpp and GuiAlert.cpp. It's set in the code, but
can be manually unset by people who don't want the risks of background
export, threading, etc. And yes, it is useful for the purpose you mentioned.



Note that one of the file erroneously tests with #ifdef instead of #if,
so I doubt that it has ever been unset. (This is fixed by my patch at
.)




Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Andrew Parsloe



On 10/07/2016 5:42 p.m., Richard Heck wrote:

On 07/10/2016 01:33 AM, Scott Kostyshak wrote:

On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:

commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
Author: Richard Heck 
Date:   Sun Jul 10 01:12:42 2016 -0400

 Fix thinko in Buffer::preview. It is possible for this routine to
 be called when we do not have a cloned Buffer, namely, if we do not
 have EXPORT_in_THREAD defined.

Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
this could be useful for debugging purposes (e.g ruling out that a bug
is due to exporting in a separate thread).


It's #defined in GuiView.cpp and GuiAlert.cpp. It's set in the code, but
can be manually unset by people who don't want the risks of background
export, threading, etc. And yes, it is useful for the purpose you mentioned.

Probably, it should be exposed via configure, etc, but no one ever did that.

Richard



I ask in near total ignorance, but "my ears pricked up" when I read 
"EXPORT_in_THREAD" and "It's set in the code, but can be manually unset 
by people who don't want the risks of background export, threading, 
etc." Is this a way to tackle http://www.lyx.org/trac/ticket/8346 on the 
problems threaded export poses for command-sequences?


Andrew

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Scott Kostyshak
On Sun, Jul 10, 2016 at 01:46:48AM -0400, Richard Heck wrote:
> On 07/10/2016 01:33 AM, Scott Kostyshak wrote:
> 
> PS I just stumbled across this when looking at #9680 (Arabic filenames
> changing e.g. to _.pdf on preview). I figured out what is happening
> there, but it is not obvious what to do about it.

I saw that. I'm glad you made progress on it. I don't know anything
about makeLatexName so I will just follow and not participate in the
discussion.

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-10 Thread Scott Kostyshak
On Sun, Jul 10, 2016 at 01:42:47AM -0400, Richard Heck wrote:
> On 07/10/2016 01:33 AM, Scott Kostyshak wrote:
> > On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:
> >> commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
> >> Author: Richard Heck 
> >> Date:   Sun Jul 10 01:12:42 2016 -0400
> >>
> >> Fix thinko in Buffer::preview. It is possible for this routine to
> >> be called when we do not have a cloned Buffer, namely, if we do not
> >> have EXPORT_in_THREAD defined.
> > Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
> > this could be useful for debugging purposes (e.g ruling out that a bug
> > is due to exporting in a separate thread).
> 
> It's #defined in GuiView.cpp and GuiAlert.cpp. It's set in the code, but
> can be manually unset by people who don't want the risks of background
> export, threading, etc. And yes, it is useful for the purpose you mentioned.
> 
> Probably, it should be exposed via configure, etc, but no one ever did that.

OK thanks. I will add this to my "debugging_tips" file, that I hope to
someday clean up and put on the Wiki.

Scott


signature.asc
Description: PGP signature


Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-09 Thread Richard Heck
On 07/10/2016 01:33 AM, Scott Kostyshak wrote:
> On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:
>> commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
>> Author: Richard Heck 
>> Date:   Sun Jul 10 01:12:42 2016 -0400
>>
>> Fix thinko in Buffer::preview. It is possible for this routine to
>> be called when we do not have a cloned Buffer, namely, if we do not
>> have EXPORT_in_THREAD defined.
> Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
> this could be useful for debugging purposes (e.g ruling out that a bug
> is due to exporting in a separate thread).

PS I just stumbled across this when looking at #9680 (Arabic filenames
changing e.g. to _.pdf on preview). I figured out what is happening
there, but it is not obvious what to do about it.

Richard



Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-09 Thread Richard Heck
On 07/10/2016 01:33 AM, Scott Kostyshak wrote:
> On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:
>> commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
>> Author: Richard Heck 
>> Date:   Sun Jul 10 01:12:42 2016 -0400
>>
>> Fix thinko in Buffer::preview. It is possible for this routine to
>> be called when we do not have a cloned Buffer, namely, if we do not
>> have EXPORT_in_THREAD defined.
> Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
> this could be useful for debugging purposes (e.g ruling out that a bug
> is due to exporting in a separate thread).

It's #defined in GuiView.cpp and GuiAlert.cpp. It's set in the code, but
can be manually unset by people who don't want the risks of background
export, threading, etc. And yes, it is useful for the purpose you mentioned.

Probably, it should be exposed via configure, etc, but no one ever did that.

Richard



Re: [LyX/master] Fix thinko in Buffer::preview. It is possible for this routine to be called when we do not have a cloned Buffer, namely, if we do not have EXPORT_in_THREAD defined.

2016-07-09 Thread Scott Kostyshak
On Sun, Jul 10, 2016 at 07:16:13AM +0200, Richard Heck wrote:
> commit d8aab4af9e6e72c835f78ba54a46687b870c25fa
> Author: Richard Heck 
> Date:   Sun Jul 10 01:12:42 2016 -0400
> 
> Fix thinko in Buffer::preview. It is possible for this routine to
> be called when we do not have a cloned Buffer, namely, if we do not
> have EXPORT_in_THREAD defined.

Thanks for fixing this. How does one set EXPORT_in_THREAD? I imagine
this could be useful for debugging purposes (e.g ruling out that a bug
is due to exporting in a separate thread).

Scott


signature.asc
Description: PGP signature