On Sat, Apr 01, 2006 at 01:24:00PM +0200, Georg Baum wrote: > Am Freitag, 31. März 2006 15:21 schrieb Enrico Forestieri:
> > I do not understand why os::internal_path can return paths like C:/xxx > > in the win32 version and cannot for the cygwin version. Note that the > > test for an absolute path already takes that into account. > > It could as well return paths like C:/xxx under cygwin. I am actually not > sure what is better. My point is that it should always do the same for a > given OS environment. If we make this configurable we only create > confusion and gain nothing. This is exactly what my patch does. I do not agree about the confusion. The checkbox in preferences is to be considered as a one-time switch. Check it and LyX always uses posix paths, uncheck it and LyX always uses C:/xxx like paths. The rationale is that who has cygwin and has all cygwin-apps, gain nothing from the win-style paths and actually he maybe *wants* to see posix paths. Then he can check the box and is done. Note that who uses cygwin for its posix features, may like to use miktex instead of tetex, or the native Imagemagick instead of the cygwin port. I took into account these cases also and in the cygwin installation I provide two scripts (convert and epstopdf) which deal with them. In this way, who accidentally checks or unchecks the checkbox is not going to have any surprise. IMO, the checkbox is added functionality and no confusion at all. > > As regards os::external_path, it should be equivalent to > > os::internal_path, > > as it is on *nix. > > Do you mean with "equivalent" that it should perform the opposite > conversion? No, I mean external_path == internal_path when output is not going to .tex files (and always using forward slashes). > The problem with the checkbox is that normal users will probably not > understand what it is for. The advantage fo the more general mechanism > would be that all the complexity can be in the configure script, and > users are only faced with it when defining a new converter. Not agreed. When they check or uncheck it, they immediately understand what it does as the paths they see in preferences (even the PATH prefix) and those they get from the file dialogs are of the requested type. They don't need to know that the configure script has already instructed LyX to output the correct path styles in .tex files. Moreover, nuking the checkbox maybe be seen as a regression... > > As it is now, os::external_path > > already returns C:/xxx style paths depending on the checkbox status. > > I want simply make that independent of \cygwin_path_fix_needed. > > I think we all agree that this is right. I take you mean the independence point, because actually the behavior of external_path is fundamentally wrong. > > Notice that it works. I use it daily without problems with a mix > > of cygwin and native apps. I use MikTeX and the native ImageMagick, > > all other programs are cygwin's. Never noticed a problem. > > So you are saying that there is no need to output cygwin style paths to > external programs? That would be great. I understand that cygwin programs > can also use native windows paths with backslashes. Is that true? Not only it is true, but they can even cope with weird things as 'C:/this\is/a\strange/path'. Indeed, when properly quoted with single quotes, this is taken as C:/this/is/a/strange/path. The only problem which can arise with a cygwin app (if it is a badly ported unix app which doesn't expect win-style paths) is when it tries to establish if the path is absolute or not in order to prepend the current dir path to it. But this is not the case with the helper apps used by LyX. > In this > case I would like the following simple solution for cygwin: > > - Use native windows paths with backslashes in external_path() No, IMO it should always use windows paths but with forward slashes. Note that even notepad and word (microsoft applications) understand this, not counting all other non-microsoft programs. Initially I had your same idea, but after thinking of it I convinced myself that using backslashes can only hurt and does not help. > - Depending on \cygwin_path_fix_needed, use either native windows paths > with forward slashes or posix paths in latex_path() Yes. > This does not need an additional checkbox, and is simple enough for > anybody to understand. Not agreed. IMO the additional checkbox is an added value and I think it will be appreciated by the many hating the C:/xxx style and wanting the look and feel of a posix app. Also note that my patch will go unnoticed by users as no visible changes will occur. Simply, all bugs will be corrected in their eyes. > > Only recently the [EMAIL PROTECTED] bug has arised, and there is another one > > that still has gone unnoticed and that I spotted browsing the sources. > > Small things, easily fixed. > > And at least the [EMAIL PROTECTED] thing has nothing to do with > external_path, > but with latex_path and mixed up internal paths. Yes, but it was due to the current state of affairs. Scuse me if I may seem crude, but studying the sources (I spent quite some time on it, even using ddd to debug things) I had the impression that the implications of the changes introduced in internal_path and external_path were not thought enough. -- Enrico