I just tried to get LyX to re-render a figure that I changed, and short 
of changing the file name to a bogus name and pressing OK and then 
changing it back I can't get the figure re-drawn.

I've been thinking a little about automatic preview picture updating 
when the file on disk has changed.

My recent installation of KDE utilises fam to monitor when files or 
directories have changed, and will subsequently update them in the file 
manager (Konqueror) when they have been changed by any external mechanism.

The fam page:
http://oss.sgi.com/projects/fam/

fam is implemented efficiently by utilising a kernel mechanism (imon) 
which provides the initial callback notification that a file has changed.

I propose that we could use this mechanism to automatically update the 
preview figures in LyX when they are changed on disk. This would be done 
by modifying InsetFigure to register the file it is displaying with fam. 
If fam notifies LyX that the file has changed, the figure would be re-drawn.

Of course this would have to be a --with-fam option to configure,  since 
fam is not available everywhere nor widely installed. However it could 
also be auto-detected by configure with a suitable macro.

I suppose there should also be an update button in the Figure dialog so 
that people without fam can still see new figures. :-)

RFC?

Ben.


Reply via email to