I have reviewed all (I think) possible problems related to paths in
cygwin. The attached is the patch I come up with. I hope that it can
be applied for 1.4.1 as it doesn't harm the other targets and is
really needed for cygwin.

I have reorganized things in this way:
1) The kind of path style to be written into .tex files is only
   decided by the configure script which checks what the correct
   style is (miktex vs cygwin tetex).
2) The "Use Cygwin-style paths" checkbox is now unrelated to the
   check performed by the configure script. When unchecked, all
   paths written to .lyx files, returned by the dialogs, and shown
   in preferences are in pseudo win-style, including the PATH prefix.
   When using win-style paths, the .lyx files written by the cygwin
   version can also be read by the native LyX version (when they
   contain absolute paths).

I have tested it quite extensively and I am confident that it works
as it should. Now, in dialogs and source files, a filename may be
input in any style (windows, posix, mixed style) and it always works.

The patch is against 1.4.x, please tell me if you need one against 1.5.

-- 
Enrico
Index: insets/insetgraphics.C
===================================================================
--- insets/insetgraphics.C      (revision 13529)
+++ insets/insetgraphics.C      (working copy)
@@ -597,7 +597,7 @@ string const InsetGraphics::prepareFile(
                        copyToDirIfNeeded(orig_file, temp_path, zipped);
 
        if (status == FAILURE)
-               return orig_file;
+               return os::latex_path(orig_file);
 
        // a relative filename should be relative to the master
        // buffer.
@@ -629,7 +629,7 @@ string const InsetGraphics::prepareFile(
                                boost::tie(status, bb_file) =
                                        copyFileIfNeeded(bb_orig_file, bb_file);
                                if (status == FAILURE)
-                                       return orig_file;
+                                       return os::latex_path(orig_file);
                                runparams.exportdata->addExternalFile("latex",
                                                bb_file);
                        }
Index: insets/ChangeLog
===================================================================
--- insets/ChangeLog    (revision 13529)
+++ insets/ChangeLog    (working copy)
@@ -1,3 +1,7 @@
+2006-03-29  Enrico Forestieri <[EMAIL PROTECTED]>
+       * insetgraphics.C (prepareFile): Fix the returned path such
+       that it is in the proper style for inclusion in a .tex file.
+
 2006-03-11  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
        *insettabular (doDispatch, insertAsciiString): 
Index: bufferlist.C
===================================================================
--- bufferlist.C        (revision 13529)
+++ bufferlist.C        (working copy)
@@ -28,6 +28,7 @@
 
 #include "support/filetools.h"
 #include "support/package.h"
+#include "support/os.h"
 
 #include <boost/bind.hpp>
 
@@ -43,6 +44,8 @@ using lyx::support::removeAutosaveFile;
 using lyx::support::package;
 using lyx::support::prefixIs;
 
+using lyx::support::os::external_path;
+
 using boost::bind;
 
 using std::auto_ptr;
@@ -379,7 +382,7 @@ Buffer * BufferList::getBufferFromTmp(st
        BufferStorage::iterator it = bstore.begin();
        BufferStorage::iterator end = bstore.end();
        for (; it < end; ++it)
-               if (prefixIs(s, (*it)->temppath()))
+               if (prefixIs(external_path(s), 
external_path((*it)->temppath())))
                        return *it;
        return 0;
 }
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 13529)
+++ ChangeLog   (working copy)
@@ -1,3 +1,12 @@
+2006-03-29  Enrico Forestieri <[EMAIL PROTECTED]>
+       * lyxrc.h: Added boolean cygwin_style_paths.
+       * lyxrc.C:
+       * lyxfunc.C:
+       * lyx_main.C: Handle cygwin_style_paths.
+       * bufferlist.C (getBufferFromTmp):
+       * exporter.C (copyFile): Fix problem with paths as on
+       cygwin they can be of different type (posix vs windows).
+
 2006-03-29  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
        * LaTeX.C (handleFoundFile): do not add directories to the
Index: exporter.C
===================================================================
--- exporter.C  (revision 13529)
+++ exporter.C  (working copy)
@@ -33,6 +33,7 @@
 #include "support/filetools.h"
 #include "support/lyxlib.h"
 #include "support/package.h"
+#include "support/os.h"
 
 #include <boost/filesystem/operations.hpp>
 
@@ -46,6 +47,7 @@ using lyx::support::OnlyFilename;
 using lyx::support::OnlyPath;
 using lyx::support::package;
 using lyx::support::prefixIs;
+using lyx::support::os::external_path;
 
 using std::find;
 using std::string;
@@ -107,7 +109,8 @@ CopyStatus copyFile(string const & forma
        // overwrite themselves. This check could be changed to
        // boost::filesystem::equivalent(sourceFile, destFile) if export to
        // other directories than the document directory is desired.
-       if (!prefixIs(OnlyPath(sourceFile), package().temp_dir()))
+       if (!prefixIs(external_path(OnlyPath(sourceFile)),
+                               external_path(package().temp_dir())))
                return ret;
 
        if (!force) {
Index: lyxfunc.C
===================================================================
--- lyxfunc.C   (revision 13529)
+++ lyxfunc.C   (working copy)
@@ -1977,6 +1977,11 @@ void actOnUpdatedPrefs(LyXRC const & lyx
                        namespace os = lyx::support::os;
                        os::cygwin_path_fix(lyxrc_new.cygwin_path_fix);
                }
+       case LyXRC::RC_CYGWIN_STYLE_PATHS:
+               if (lyxrc_orig.cygwin_style_paths != 
lyxrc_new.cygwin_style_paths) {
+                       namespace os = lyx::support::os;
+                       os::cygwin_style_paths(lyxrc_new.cygwin_style_paths);
+               }
        case LyXRC::RC_DATE_INSERT_FORMAT:
        case LyXRC::RC_DEFAULT_LANGUAGE:
        case LyXRC::RC_DEFAULT_PAPERSIZE:
Index: frontends/qt2/QPrefs.C
===================================================================
--- frontends/qt2/QPrefs.C      (revision 13529)
+++ frontends/qt2/QPrefs.C      (working copy)
@@ -148,6 +148,11 @@ string const internal_path(QString const
        return lyx::support::os::internal_path(fromqstr(input));
 }
 
+string const internal_path_list(QString const & input)
+{
+       return lyx::support::os::internal_path_list(fromqstr(input));
+}
+
 }
 
 
@@ -199,7 +204,7 @@ void QPrefs::apply()
 
 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
        QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
-       rc.cygwin_path_fix = cygwinmod->pathCB->isChecked();
+       rc.cygwin_style_paths = cygwinmod->pathCB->isChecked();
 #endif
 
        QPrefLatexModule * latexmod(dialog_->latexModule);
@@ -253,7 +258,7 @@ void QPrefs::apply()
        rc.template_path = internal_path(pathsmod->templateDirED->text());
        rc.backupdir_path = internal_path(pathsmod->backupDirED->text());
        rc.tempdir_path = internal_path(pathsmod->tempDirED->text());
-       rc.path_prefix = fromqstr(pathsmod->pathPrefixED->text());
+       rc.path_prefix = internal_path_list(pathsmod->pathPrefixED->text());
        // FIXME: should be a checkbox only
        rc.lyxpipes = internal_path(pathsmod->lyxserverDirED->text());
 
@@ -467,6 +472,11 @@ QString const external_path(string const
        return toqstr(lyx::support::os::external_path(input));
 }
 
+QString const external_path_list(string const & input)
+{
+       return toqstr(lyx::support::os::external_path_list(input));
+}
+
 }
 
 
@@ -536,7 +546,7 @@ void QPrefs::update_contents()
 
 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
        QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
-       cygwinmod->pathCB->setChecked(rc.cygwin_path_fix);
+       cygwinmod->pathCB->setChecked(rc.cygwin_style_paths);
 #endif
 
        QPrefLatexModule * latexmod(dialog_->latexModule);
@@ -583,7 +593,7 @@ void QPrefs::update_contents()
        pathsmod->templateDirED->setText(external_path(rc.template_path));
        pathsmod->backupDirED->setText(external_path(rc.backupdir_path));
        pathsmod->tempDirED->setText(external_path(rc.tempdir_path));
-       pathsmod->pathPrefixED->setText(toqstr(rc.path_prefix));
+       pathsmod->pathPrefixED->setText(external_path_list(rc.path_prefix));
        // FIXME: should be a checkbox only
        pathsmod->lyxserverDirED->setText(external_path(rc.lyxpipes));
 
Index: frontends/qt2/ChangeLog
===================================================================
--- frontends/qt2/ChangeLog     (revision 13529)
+++ frontends/qt2/ChangeLog     (working copy)
@@ -1,3 +1,10 @@
+2006-03-29  Enrico Forestieri <[EMAIL PROTECTED]>
+       * FileDialog.C: Use the native file dialog when building for
+       cygwin with native Qt graphics and let the dialogs return the
+       paths in the user-prefs style.
+       * QPrefs.C: Handle the PATH prefix style according to the
+       user-prefs style.
+
 2006-03-28  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
        * QPrefsDialog.C (remove_format): Prevent deletion of file formats
Index: frontends/qt2/FileDialog.C
===================================================================
--- frontends/qt2/FileDialog.C  (revision 13529)
+++ frontends/qt2/FileDialog.C  (working copy)
@@ -21,6 +21,10 @@
 
 #include "support/filefilterlist.h"
 
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#include "support/os.h"
+#endif
+
 /** when this is defined, the code will use
  * QFileDialog::getOpenFileName and friends to create filedialogs.
  * Effects:
@@ -30,7 +34,7 @@
  *
  * Therefore there is a tradeoff in enabling or disabling this (JMarc)
  */
-#ifdef Q_WS_MACX
+#if defined(Q_WS_MACX) || defined(Q_CYGWIN_WIN)
 #define USE_NATIVE_FILEDIALOG 1
 #endif
 
@@ -99,6 +103,9 @@ FileDialog::Result const FileDialog::sav
                result.second = fromqstr(dlg.selectedFile());
        dlg.hide();
 #endif
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+       result.second = lyx::support::os::internal_path(result.second);
+#endif
        return result;
 }
 
@@ -133,6 +140,9 @@ FileDialog::Result const FileDialog::ope
                result.second = fromqstr(dlg.selectedFile());
        dlg.hide();
 #endif
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+       result.second = lyx::support::os::internal_path(result.second);
+#endif
        return result;
 }
 
@@ -167,6 +177,9 @@ FileDialog::Result const FileDialog::ope
        if (res == QDialog::Accepted)
                result.second = fromqstr(dlg.selectedFile());
        dlg.hide();
+#endif
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+       result.second = lyx::support::os::internal_path(result.second);
 #endif
        return result;
 }
Index: frontends/xforms/FormPreferences.C
===================================================================
--- frontends/xforms/FormPreferences.C  (revision 13529)
+++ frontends/xforms/FormPreferences.C  (working copy)
@@ -2074,7 +2074,7 @@ void FormPreferences::OutputsMisc::apply
        rc.auto_reset_options = 
fl_get_button(dialog_->check_autoreset_classopt);
 
 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
-       rc.cygwin_path_fix = fl_get_button(dialog_->check_cygwin_path);
+       rc.cygwin_style_paths = fl_get_button(dialog_->check_cygwin_path);
 #endif
 }
 
@@ -2142,10 +2142,7 @@ FormPreferences::OutputsMisc::feedback(F
 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
        if (ob == dialog_->check_cygwin_path)
                return _("Select if LyX should output Cygwin-style paths "
-                        "rather than Windows-style paths. Useful if you're "
-                        "using the Cygwin teTeX rather than a native Windows "
-                        "MikTeX. Note, however, that you'll need to write "
-                        "shell script wrappers for all your converters.");
+                        "rather than Windows-style paths.");
 #endif
        return string();
 }
@@ -2172,7 +2169,7 @@ void FormPreferences::OutputsMisc::updat
        fl_set_button(dialog_->check_autoreset_classopt,
                      rc.auto_reset_options);
 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
-       fl_set_button(dialog_->check_cygwin_path, rc.cygwin_path_fix);
+       fl_set_button(dialog_->check_cygwin_path, rc.cygwin_style_paths);
 #endif
 }
 
Index: frontends/xforms/ChangeLog
===================================================================
--- frontends/xforms/ChangeLog  (revision 13529)
+++ frontends/xforms/ChangeLog  (working copy)
@@ -1,3 +1,6 @@
+2006-03-29  Enrico Forestieri <[EMAIL PROTECTED]>
+       * FormPreferences.C: renamed cygwin_path_fix to cygwin_style_paths.
+
 2006-03-22  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
        * FormDocument.C (options_apply): do not return a bool anymore
Index: support/os.h
===================================================================
--- support/os.h        (revision 13529)
+++ support/os.h        (working copy)
@@ -26,6 +26,11 @@ enum shell_type {
        CMD_EXE
 };
 
+enum path_target {
+       FILE_SYSTEM,
+       LATEX_FILE
+};
+
 /// Do some work just once.
 void init(int argc, char * argv[]);
 
@@ -45,7 +50,14 @@ std::string::size_type common_path(std::
 std::string external_path(std::string const & p);
 
 /// Converts a host OS style path to unix style.
-std::string internal_path(std::string const & p);
+std::string internal_path(std::string const & p,
+                       path_target target = FILE_SYSTEM);
+
+/// Converts a unix style path list to host OS style.
+std::string external_path_list(std::string const & p);
+
+/// Converts a host OS style path list to unix style.
+std::string internal_path_list(std::string const & p);
 
 /**
  * Converts a unix style path into a form suitable for inclusion in a LaTeX
@@ -68,11 +80,30 @@ char const * popen_read_mode();
  */
 char path_separator();
 
-/** If @c use_cygwin_paths is true, LyX will output cygwin style paths
- *  rather than native Win32 ones. Obviously, this option is used only
- *  under Cygwin.
+/** If @c fix_cygwin_paths is true, LyX will output cygwin style paths
+ *  rather than native Win32 ones in latex files. Obviously, this option
+ *  is used only under Cygwin.
  */
-void cygwin_path_fix(bool use_cygwin_paths);
+void cygwin_path_fix(bool fix_cygwin_paths);
+
+/** If @c use_cygwin_paths is true, LyX will use/show cygwin style paths
+ *  rather than native Win32 ones in the GUI. Obviously, this option
+ *  is used only under Cygwin.
+ */
+void cygwin_style_paths(bool use_cygwin_paths);
+
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+enum PathStyle {
+    posix,
+    windows
+};
+
+/// Converts a path to a target style.
+std::string convert_path(std::string const & p, PathStyle const & target);
+
+/// Converts a path list to a target style.
+std::string convert_path_list(std::string const & p, PathStyle const & target);
+#endif
 
 } // namespace os
 } // namespace support
Index: support/filetools.C
===================================================================
--- support/filetools.C (revision 13529)
+++ support/filetools.C (working copy)
@@ -86,9 +86,8 @@ string const latex_path(string const & o
                latex_path_extension extension,
                latex_path_dots dots)
 {
-       string path = subst(original_path, "\\", "/");
        // On cygwin, we may need windows or posix style paths.
-       path = os::latex_path(path);
+       string path = os::latex_path(original_path);
        path = subst(path, "~", "\\string~");
        if (path.find(' ') != string::npos) {
                // We can't use '"' because " is sometimes active (e.g. if
@@ -766,7 +765,8 @@ string const ChangeExtension(string cons
        else
                ext = extension;
 
-       return os::internal_path(oldname.substr(0, last_dot) + ext);
+       return os::internal_path(oldname.substr(0, last_dot) + ext,
+                                                       os::LATEX_FILE);
 }
 
 
Index: support/os_win32.C
===================================================================
--- support/os_win32.C  (revision 13529)
+++ support/os_win32.C  (working copy)
@@ -210,18 +210,31 @@ string const get_long_path(string const 
 } // namespace anon
 
 
-string internal_path(string const & p)
+string internal_path(string const & p, path_target target)
 {
+       (void)target; // Silence warning about unused variable.
        return subst(get_long_path(p), "\\", "/");
 }
 
 
-string latex_path(string const & p)
+string external_path_list(string const & p)
 {
        return p;
 }
 
 
+string internal_path_list(string const & p)
+{
+       return p;
+}
+
+
+string latex_path(string const & p)
+{
+       return subst(p, '\\', '/');
+}
+
+
 // (Claus H.) On Win32 both Unix and Win32/DOS pathnames are used.
 // Therefore an absolute path could be either a pathname starting
 // with a slash (Unix) or a pathname starting with a drive letter
@@ -268,6 +281,10 @@ char path_separator()
 
 
 void cygwin_path_fix(bool)
+{}
+
+
+void cygwin_style_paths(bool)
 {}
 
 
Index: support/ChangeLog
===================================================================
--- support/ChangeLog   (revision 13529)
+++ support/ChangeLog   (working copy)
@@ -1,3 +1,13 @@
+2006-03-29  Enrico Forestieri <[EMAIL PROTECTED]>
+       * os.h: Added new declarations to deal with PATH lists.
+       * os_cygwin.C: Major rewrite to account for path style problems.
+       * os_unix.C:
+       * os_win32.C: Added stub functions for PATH lists.
+       * environment.C: fix bug 2344: Wrong path_prefix handling in
+       cygwin builds
+       * filetools.C (latex_path, ChangeExtension): fix for the path
+       style to be written in .tex files (cygwin related).
+
 2006-03-28  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
        * Makefile.am (libsupport_la_SOURCES): add RandomAccessList.h.
Index: support/os_cygwin.C
===================================================================
--- support/os_cygwin.C (revision 13529)
+++ support/os_cygwin.C (working copy)
@@ -65,40 +65,97 @@ string::size_type common_path(string con
 namespace {
 
 bool cygwin_path_fix_ = false;
+bool cygwin_style_paths_ = false;
+
+using lyx::support::contains;
+
+bool is_posix_path(string const & p)
+{
+       return  p.empty() ||
+               (!contains(p, '\\') && (p.length() < 1 || p[1] != ':'));
+}
+
+// Windows path really is a win32 style path with forward slashes.
+
+bool is_windows_path(string const & p)
+{
+       return p.empty() ||
+               (!contains(p, '\\') && (p.length() < 1 || p[1] == ':'));
+}
 
 } // namespace anon
 
 
-string external_path(string const & p)
+string convert_path(string const & p, PathStyle const & target)
 {
-       string dos_path;
+       char path_buf[PATH_MAX];
+
+       if ((target == posix && is_posix_path(p)) ||
+           (target == windows && is_windows_path(p)))
+               return p;
+
+       path_buf[0] = '\0';
+
+       if (target == posix)
+               cygwin_conv_to_posix_path(p.c_str(), path_buf);
+       else
+               cygwin_conv_to_win32_path(p.c_str(), path_buf);
+
+       return subst(path_buf[0] ? path_buf : p, '\\', '/');
+}
+
+
+string convert_path_list(string const & p, PathStyle const & target)
+{
+       char const * const pc = p.c_str();
+       PathStyle const actual = cygwin_posix_path_list_p(pc) ? posix : windows;
+
+       if (target != actual) {
+               int const target_size = (target == posix) ?
+                               cygwin_win32_to_posix_path_list_buf_size(pc) :
+                               cygwin_posix_to_win32_path_list_buf_size(pc);
 
-       // Translate from cygwin path syntax to dos path syntax
-       if (cygwin_path_fix_ && is_absolute_path(p)) {
-               char dp[PATH_MAX];
-               cygwin_conv_to_full_win32_path(p.c_str(), dp);
-               dos_path = !dp ? "" : dp;
+               char * ptr = new char[target_size];
+
+               if (ptr) {
+                       if (target == posix)
+                               cygwin_win32_to_posix_path_list(pc, ptr);
+                       else
+                               cygwin_posix_to_win32_path_list(pc, ptr);
+
+                       string path_list = subst(ptr, '\\', '/');
+                       delete ptr;
+                       return path_list;
+               }
        }
 
-       else return p;
+       return p;
+}
+
+
+string external_path(string const & p)
+{
+       return convert_path(p, cygwin_style_paths_ ? PathStyle(posix)
+                                                  : PathStyle(windows));
+}
+
+
+string internal_path(string const & p, path_target target)
+{
+       return (target == LATEX_FILE) ? latex_path(p) : external_path(p);
+}
 
-       //No backslashes in LaTeX files
-       dos_path = subst(dos_path,'\\','/');
 
-       lyxerr[Debug::LATEX]
-               << "<Cygwin path correction> ["
-               << p << "]->>["
-               << dos_path << ']' << endl;
-       return dos_path;
+string external_path_list(string const & p)
+{
+       return convert_path_list(p, cygwin_style_paths_ ? PathStyle(posix)
+                                                       : PathStyle(windows));
 }
 
 
-string internal_path(string const & p)
+string internal_path_list(string const & p)
 {
-       char posix_path[PATH_MAX];
-       posix_path[0] = '\0';
-       cygwin_conv_to_posix_path(p.c_str(), posix_path);
-       return posix_path;
+       return convert_path_list(p, PathStyle(posix));
 }
 
 
@@ -107,7 +164,11 @@ string latex_path(string const & p)
        // We may need a posix style path or a windows style path (depending
        // on cygwin_path_fix_), but we use always forward slashes, since it
        // gets written into a .tex file.
-       return external_path(p);
+
+       if (is_absolute_path(p))
+               return convert_path(p, cygwin_path_fix_ ? PathStyle(windows)
+                                                       : PathStyle(posix));
+       return p;
 }
 
 
@@ -150,9 +211,15 @@ char path_separator()
 }
 
 
-void cygwin_path_fix(bool use_cygwin_paths)
+void cygwin_path_fix(bool fix_cygwin_paths)
+{
+       cygwin_path_fix_ = fix_cygwin_paths;
+}
+
+
+void cygwin_style_paths(bool use_cygwin_paths)
 {
-       cygwin_path_fix_ = use_cygwin_paths;
+       cygwin_style_paths_ = use_cygwin_paths;
 }
 
 } // namespace os
Index: support/environment.C
===================================================================
--- support/environment.C       (revision 13529)
+++ support/environment.C       (working copy)
@@ -95,7 +95,11 @@ void setEnvPath(string const & name, vec
        for (; it != end; ++it) {
                if (it != begin)
                        ss << separator;
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+               ss << os::convert_path(*it, os::posix);
+#else
                ss << os::external_path(*it);
+#endif
        }
        setEnv(name, ss.str());
 }
Index: support/package.C.in
===================================================================
--- support/package.C.in        (revision 13529)
+++ support/package.C.in        (working copy)
@@ -346,7 +346,7 @@ string const get_temp_dir()
        GetTempPath(PATH_MAX, path);
        return os::internal_path(path);
 #else // Posix-like.
-       return "/tmp";
+       return os::internal_path("/tmp");
 #endif
 }
 
Index: lyxrc.C
===================================================================
--- lyxrc.C     (revision 13529)
+++ lyxrc.C     (working copy)
@@ -81,6 +81,7 @@ keyword_item lyxrcTags[] = {
        { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
        { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
        { "\\cygwin_path_fix_needed", LyXRC::RC_CYGWIN_PATH_FIX },
+       { "\\cygwin_style_paths_wanted", LyXRC::RC_CYGWIN_STYLE_PATHS },
        { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
        { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
        { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
@@ -271,6 +272,7 @@ void LyXRC::setDefaults() {
        default_language = "english";
        show_banner = true;
        cygwin_path_fix = false;
+       cygwin_style_paths = false;
        tex_allows_spaces = false;
        date_insert_format = "%A, %e %B %Y";
        cursor_follows_scrollbar = false;
@@ -394,6 +396,12 @@ int LyXRC::read(LyXLex & lexrc)
                        }
                        break;
 
+               case RC_CYGWIN_STYLE_PATHS:
+                       if (lexrc.next()) {
+                               cygwin_style_paths = lexrc.getBool();
+                       }
+                       break;
+
                case RC_TEX_ALLOWS_SPACES:
                        if (lexrc.next()) {
                                tex_allows_spaces = lexrc.getBool();
@@ -1342,6 +1350,12 @@ void LyXRC::write(ostream & os, bool ign
                        os << "\\cygwin_path_fix_needed "
                           << convert<string>(cygwin_path_fix) << '\n';
                }
+       case RC_CYGWIN_STYLE_PATHS:
+               if (ignore_system_lyxrc ||
+                   cygwin_style_paths != system_lyxrc.cygwin_style_paths) {
+                       os << "\\cygwin_style_paths_wanted "
+                          << convert<string>(cygwin_style_paths) << '\n';
+               }
        case RC_TEX_ALLOWS_SPACES:
                if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
                        os << "\\tex_allows_spaces "
@@ -2137,6 +2151,9 @@ string const LyXRC::getDescription(LyXRC
                break;
 
        case RC_CYGWIN_PATH_FIX:
+               break;
+
+       case RC_CYGWIN_STYLE_PATHS:
                break;
 
        case RC_DATE_INSERT_FORMAT:
Index: lyxrc.h
===================================================================
--- lyxrc.h     (revision 13529)
+++ lyxrc.h     (working copy)
@@ -52,6 +52,7 @@ public:
                RC_CUSTOM_EXPORT_COMMAND,
                RC_CUSTOM_EXPORT_FORMAT,
                RC_CYGWIN_PATH_FIX,
+               RC_CYGWIN_STYLE_PATHS,
                RC_DATE_INSERT_FORMAT,
                RC_DEFAULT_LANGUAGE,
                RC_DEFAULT_PAPERSIZE,
@@ -376,8 +377,10 @@ public:
        std::string user_name;
        /// user email
        std::string user_email;
-       ///
+       /// True if the TeX engine should use mixed windows/unix style paths
        bool cygwin_path_fix;
+       /// True if LyX should use/show posix style paths in the GUI
+       bool cygwin_style_paths;
        /// True if the TeX engine can handle file names containing spaces
        bool tex_allows_spaces;
        /** Prepend paths to the PATH environment variable.
Index: lyx_main.C
===================================================================
--- lyx_main.C  (revision 13529)
+++ lyx_main.C  (working copy)
@@ -475,6 +475,7 @@ void LyX::init(bool gui)
                lyxrc.print();
 
        os::cygwin_path_fix(lyxrc.cygwin_path_fix);
+       os::cygwin_style_paths(lyxrc.cygwin_style_paths);
        if (!lyxrc.path_prefix.empty())
                prependEnvPath("PATH", lyxrc.path_prefix);
 

Reply via email to