Jean-Marc,
I have been mulling over how best to overcome the limitations in my new 
FileName class that you pointed out in Chemnitz. I think that this 
algorithm should work well:

The FileName class should be able to handle three possibilities

1. Input/Output the absolute filename.
Store
        string file = <absolute filename>;
        bool output_absolute_filename = true;

2. Input/Output the filename relative to Buffer::filePath().
Store
        string file = <absolute filename>;
        bool output_absolute_filename = false;
Pass the output function Buffer::filePath() or set Path appropriately.

3. Input/Output a relative filename. The file is found using TeX magic 
(TEXINPUTS, BIBINPUTS etc).
        string file = <relative filename>;
        bool output_absolute_filename = false;

When inputing a new bibtex database in the bibtex dialog, we check whether a 
filename with relative path can be found with the Buffer::filePath. If it 
can, we use case 2. If not, we test whether TeX can find it. If it can, we 
use case 3, else we use case 2 and assume that the file does not exist.

In all three cases, if the inset is cut and pasted to another buffer, then 
its contents do not change.

-- 
Angus

Reply via email to