Re: lyx changes the file access privileges

2018-12-07 Thread Pavel Sanda
On Sat, Nov 24, 2018 at 10:11:37PM -0500, Richard Kimberly Heck wrote:
> > I blame global warming.
> 
> 
> I do not believe LyX sets file permissions itself. The write routine
> simply uses basic_ofstream, which just creates the file using the
> current umask, or whatever other default permissions are in place.

It's actually not that simple.

It's in LyX for years now and I believe it traces back to times when we
start getting the reports that on some ext4 filesystems power outage resulted
in .lyx files truncated to zero.

The underlying issue was that some smart kernel devs suddenly decided that 
syncing
journal record (eg. record "rewrite of file") and writing the content of file
itself are not actions which necesarilly need to happen at the same time and
the time window between could be actually quite big (tenths of seconds). If in
that window of oportunity you lost power the only thing left on your harddrive
was empty .lyx file (just after innocent save).

So what lyx start doing after that is actually more complex that just saving 
file - 
there is hidden movement charade of files behind the scenes when you save
the file to avoid the problems mentioned above - and probably somewhere in
this game the permissions go south... 

That would also likely explain why there is chaos with different permissions
on your drives and newly created file do look different than resaved ones.

Pavel


Re: Commented TeX with track changes

2018-12-07 Thread Daniel

On 07/12/2018 09:53, Jean-Marc Lasgouttes wrote:

Le 06/12/2018 à 23:39, Daniel Goya a écrit :

Hello everyone,

I just realised that I could not compile a file displaying changes, 
when the change, within a TeX code, includes a %.


This is a bug indeed, but I have no idea how we can solve it. This is a 
general issue with ERT: you can find 100 ways to break documents with it.


The question is whether we can solve it (or even want to try).

JMarc



I guess one drastic way to deal with the problem would be to disallow 
change tracking in ERTs. A less drastic one to show a message when using 
it in ERTs so that the user knows his code might not work as expected.


Daniel



Re: Commented TeX with track changes

2018-12-07 Thread Jean-Marc Lasgouttes

Le 06/12/2018 à 23:39, Daniel Goya a écrit :

Hello everyone,

I just realised that I could not compile a file displaying changes, when 
the change, within a TeX code, includes a %.


This is a bug indeed, but I have no idea how we can solve it. This is a 
general issue with ERT: you can find 100 ways to break documents with it.


The question is whether we can solve it (or even want to try).

JMarc