On Thu, Mar 30, 2006 at 05:33:31PM +0200, Georg Baum wrote:

> I did not yet have time to comment on Enricos patch, I just had a quick look
> and the cygwin ifdefs he introduced in frontends/qt2/FileDialog.C don't
> seem right. If they are really needed (which I doubt currently, but that
> may change after reading the whole patch) we should introduce just another
> patch function. That way, we get nice clean code and the ugly stuff is
> banned to few files in src/support.

I try to explain again why I did that.

In Windows one could use miktex or tetex (by cygwin). But, as things
stand now, tetex cannot be used because, for reasons not known to me,
it gives an error when a path like "C:/xxx" is output to a .tex file.
I think that it is related to the fact that a check for a posix-style
absolute path is being made, but I have not read the tetex sources and
cannot be sure.

I think that in Windows all files output to a .tex file should be
obtained by os::latex_file() which, according to the cygwin_path_fix
switch, should return either "C:/xxx" or "/cygdrive/c/xxx".

So, three functions are needed:

1) os::internal_path     for paths used internally by LyX
2) os::external_path     for paths intended to be used by external programs
3) os::latex_path        for paths going to .tex files

In *nix all of them are noops. In native win32 1) and 2) simply differ
in the path separator, whereas 3) should give either pseudo-win paths
or posix paths according to wheter miktex or tetex is used (this is
what cygwin_path_fix tells you).

In cygwin, things could be exactly as in *nix, but if you want to allow
for miktex, than 3) above should be exactly as for native win32 (as it
should be, I mean, not as it is now).
However, you could also use other native apps apart from miktex, so it
is useful that both 1) and 2) return either posix- or win-style paths.
This is to be independent from the cygwin_path_fix switch and in my
patch it is done through the "Use Cygwin-style paths" checkbox.

As a cygwin app can deal with both posix or win-style paths, we could
simply ditch the "Use Cygwin-style paths" checkbox and make 1) and 2)
always return pseudo win-style paths (I mean with forward slashes
because it seems that most windows programs understand that, even
notepad and word have no problems with forward slahes). But chances are
high that if you have cygwin, you also use all-cygwin apps, and if one
of them tries to be smart about deciding that a path is absolute or not,
you are in trouble, because you suddenly find that the current dir path
is prepended to your already absolute path.

For this reason I think that the checkbox should stay.

One input source from which a path is entered is the file dialog,
so I simply pass its output to os::internal_path which returns a path
in the style dictated by the "Use Cygwin-style paths" checkbox.

This is the logic driving my patch and I am sure that it can be
implemented in a better way than I did, but I don't want to be
one which simply asks for something and I think it is helpful to start
from an almost working implementation rather than from scratch.

If you do not agree with this vision, I am fine anyway. I do not want
to make a pressure on you as I have the sources and can build my own
version of LyX.

However, the cygwin version that I made available is the one I am using,
so if my copy is different from the official sources and this is not
acceptable for you, I will not provide other versions if you ask so, as
I don't want that you get blamed for it.

Anyway, I would like to thank you for LyX which I am using from version
0.10 (I think I still have the COLD program lying on the hard disk).

-- 
Enrico

Reply via email to