Re: Automatically reload externally changed ".lyx" files?

2018-04-16 Thread Scott Kostyshak
On Mon, Apr 16, 2018 at 09:18:34AM +, Klaus-Dieter Bauer wrote:
> I have created a trac-ticket a while back ( https://www.lyx.org/trac/
> ticket/10997 ) and now added the discussion from here to the ticket.

Thank you!

Scott


signature.asc
Description: PGP signature


Re: Automatically reload externally changed ".lyx" files?

2018-04-16 Thread Klaus-Dieter Bauer
I have created a trac-ticket a while back ( https://www.lyx.org/trac/
ticket/10997 ) and now added the discussion from here to the ticket.

2018-04-14 23:42 GMT+02:00 Scott Kostyshak :

> On Mon, Mar 05, 2018 at 09:52:32PM +, Guillaume Munch wrote:
> > On Sat, Mar 3, 2018 at 2:16 PM, Scott Kostyshak 
> wrote:
> >
> > > On Fri, Mar 02, 2018 at 02:12:36PM +, Klaus-Dieter Bauer wrote:
> > >
> > > > A direct comparison is probably difficult, as LyX draws especially
> much
> > > > information from background files (macro definitions, TOC, ...).
> > >
> > > Thanks for that great research, Klaus, and all of those details! I'm
> > > CC'ing Guillaume. He has worked on this feature so might have an
> opinion
> > > on this thread. We might want to eventually open a trac ticket for this
> > > so that it does not get lost in the mail archives.
> > >
> > > Scott
> > >
> >
> > Hello, it is a good idea to automatically reload background files. This
> is
> > not so simple, though, because the change notification can happen at
> random
> > times and it is not clear that the code is ready for this. I have an idea
> > to make it work, but this will need to wait that I am back from holidays.
> > It is best to open a ticket for now.
>
> Klaus, did you open a trac ticket for this? It would be great if you
> could do that and summarize the conversation.
>
> Thanks,
>
> Scott
>


Re: Automatically reload externally changed ".lyx" files?

2018-04-14 Thread Scott Kostyshak
On Mon, Mar 05, 2018 at 09:52:32PM +, Guillaume Munch wrote:
> On Sat, Mar 3, 2018 at 2:16 PM, Scott Kostyshak  wrote:
> 
> > On Fri, Mar 02, 2018 at 02:12:36PM +, Klaus-Dieter Bauer wrote:
> >
> > > A direct comparison is probably difficult, as LyX draws especially much
> > > information from background files (macro definitions, TOC, ...).
> >
> > Thanks for that great research, Klaus, and all of those details! I'm
> > CC'ing Guillaume. He has worked on this feature so might have an opinion
> > on this thread. We might want to eventually open a trac ticket for this
> > so that it does not get lost in the mail archives.
> >
> > Scott
> >
> 
> Hello, it is a good idea to automatically reload background files. This is
> not so simple, though, because the change notification can happen at random
> times and it is not clear that the code is ready for this. I have an idea
> to make it work, but this will need to wait that I am back from holidays.
> It is best to open a ticket for now.

Klaus, did you open a trac ticket for this? It would be great if you
could do that and summarize the conversation.

Thanks,

Scott


signature.asc
Description: PGP signature


Re: Automatically reload externally changed ".lyx" files?

2018-03-06 Thread Guillaume Munch
On Sat, Mar 3, 2018 at 2:16 PM, Scott Kostyshak  wrote:

> On Fri, Mar 02, 2018 at 02:12:36PM +, Klaus-Dieter Bauer wrote:
>
> > A direct comparison is probably difficult, as LyX draws especially much
> > information from background files (macro definitions, TOC, ...).
>
> Thanks for that great research, Klaus, and all of those details! I'm
> CC'ing Guillaume. He has worked on this feature so might have an opinion
> on this thread. We might want to eventually open a trac ticket for this
> so that it does not get lost in the mail archives.
>
> Scott
>

Hello, it is a good idea to automatically reload background files. This is
not so simple, though, because the change notification can happen at random
times and it is not clear that the code is ready for this. I have an idea
to make it work, but this will need to wait that I am back from holidays.
It is best to open a ticket for now.

Guillaume


Re: Automatically reload externally changed ".lyx" files?

2018-03-03 Thread Scott Kostyshak
On Fri, Mar 02, 2018 at 02:12:36PM +, Klaus-Dieter Bauer wrote:

> A direct comparison is probably difficult, as LyX draws especially much
> information from background files (macro definitions, TOC, ...).

Thanks for that great research, Klaus, and all of those details! I'm
CC'ing Guillaume. He has worked on this feature so might have an opinion
on this thread. We might want to eventually open a trac ticket for this
so that it does not get lost in the mail archives.

Scott


signature.asc
Description: PGP signature


Re: Automatically reload externally changed ".lyx" files?

2018-03-02 Thread Klaus-Dieter Bauer
2018-03-01 18:46 GMT+01:00 Scott Kostyshak :

> On Mon, Jan 22, 2018 at 12:39:22PM +, Klaus-Dieter Bauer wrote:
> > Hello!
> >
> > At least as of LyX 2.3.0 LyX displays a "Reload file" prompt, if it
> detects
> > that the LyX file has been changed externally, e.g. by Dropbox, external
> > version control, or user scripts. As a great bonus, LyX even checks if
> the
> > contents (not only the modification time) has changed.
> >
> > However, when changing a lot of files at once (e.g. checking out an
> earlier
> > version of a document with many child-documents from Git), each file has
> a
> > separate prompt, and even files that were previously opened only
> invisibly
> > in the background are suddenly visible. The best work-around I could
> > idemtify, was to close and restart LyX having enabled the setting
> *“Tools →
> > Preferences → Look & Feel → Document Handling → Load opened files from
> last
> > session”.*
> >
> > Is it possible to make LyX silently automatically reload the files, if no
> > changes were made inside LyX since the last save?
>
> Makes sense. Do you know how any other program behaves in similar
> situations? We try to follow convention when we can.
>
> Scott


A direct comparison is probably difficult, as LyX draws especially much
information from background files (macro definitions, TOC, ...).  But both
TeXStudio and Emacs (with *[global-]auto-revert-mode*) automatically reload
files when there is no conflict.



* TeXStudio. Seems to do pretty much what I was trying to achieve. - For an
open file, - If it doesn't have unsaved changes, the file is silently
reloaded from disk.- If it has unsaved changes, a prompt asks if it should
be reloaded.- Background files- cannot contain unsaved changes (apparently
the same as in LyX)- Macro definitions found in background files are
silently reloaded, if the file changes.*
*Emacs with "auto-revert-mode".* Also quite similar.

   - If the buffer contents are unchanged, but the file has changed, the
   buffer is automatically reloaded with only a log message. Checks for
   changes occur periodically every *``auto-revert-interval``* seconds.
   Since Emacs doesn't distinguish between visible and invisible buffers, this
   happens entirely in the background.
   - If the buffer contents are changed, a warning is displayed when the
   user is trying to overwrite the file with the changes made inside Emacs.

Without auto-revert-mode, the user is prompted for a reload when starting
to edit the buffer whose file has been changed.

Probably for historical reasons, Emacs polls the opened files for changes,
which probably incurs some performance overhead. (Setting
*auto-revert-interval* too low is really noticable).

- Klaus


Re: Automatically reload externally changed ".lyx" files?

2018-03-01 Thread Scott Kostyshak
On Mon, Jan 22, 2018 at 12:39:22PM +, Klaus-Dieter Bauer wrote:
> Hello!
> 
> At least as of LyX 2.3.0 LyX displays a "Reload file" prompt, if it detects
> that the LyX file has been changed externally, e.g. by Dropbox, external
> version control, or user scripts. As a great bonus, LyX even checks if the
> contents (not only the modification time) has changed.
> 
> However, when changing a lot of files at once (e.g. checking out an earlier
> version of a document with many child-documents from Git), each file has a
> separate prompt, and even files that were previously opened only invisibly
> in the background are suddenly visible. The best work-around I could
> idemtify, was to close and restart LyX having enabled the setting *“Tools →
> Preferences → Look & Feel → Document Handling → Load opened files from last
> session”.*
> 
> Is it possible to make LyX silently automatically reload the files, if no
> changes were made inside LyX since the last save?

Makes sense. Do you know how any other program behaves in similar
situations? We try to follow convention when we can.

Scott


signature.asc
Description: PGP signature