>>>>> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes:

>> Because they are already there if they need to.
Bo> That is fine. Adding them the second time will not change
Bo> anything.

No, the list is a list of files opened via command-line or File>Open.
Session stuff should not interfere with that. Keeping the features
orthogonal is better.

>> For example, if you use Help>Intro, the Intro file will not be
>> added to recent files. If it is kept open, your patch means the
>> file will be added at restart. This is wrong.

Bo> This is a separate issue. If you try to open a help file from the
Bo> help menu, LFUN_HELPOPEN will be triggered and loadLyxFile(file,
Bo> false) will be called. The file will not appear in lastfiles. If
Bo> you start lyx with "lyx doc/.../tutorial.lyx", the file will be
Bo> added to lastfiles.

Exactly. In one case you read help, in the other one you edit a file. 

Bo> Since such help files should go to lastopenedfiles, I can think of
Bo> two solutions

Bo> 1. at start up, try to tell lyx to use loadLyxFile(file, false)
Bo> for such files. This is difficult

But this is what we should do. I am sure this is not so difficult
after all. I have not understood your code very well, but it seems
that you hijack command line handling instead of opening the files by
yourself. 

Bo> 2. remove the second parameter and check the nature of files added
Bo> internally, maybe by checking file path. This is doable if help
Bo> doc is the only file type that use loadLyxFile(.., false).

Please not. See above.

Finally, concerning the problem of files that get loaded several
times, I think the right thing to do is to change
BufferView::Pimpl::loadLyXFile so that if the file is already loaded
but is unchanged, the user is not prompted to revert the file, but LyX
silently switches to this file. This is a natural thing to do and
fixes elegantly the problem you have with child documents (please the
remove the ad-hoc code that you committed).

JMarc

Reply via email to