2018-03-01 18:46 GMT+01:00 Scott Kostyshak <skost...@lyx.org>: > On Mon, Jan 22, 2018 at 12:39:22PM +0000, 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