On Mon, Jun 26, 2006 at 08:28:51PM +0200, Enrico Forestieri wrote:
> On Mon, Jun 26, 2006 at 06:43:04PM +0200, Jean-Marc Lasgouttes wrote:
>
> > >>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes:
> >
> > Georg> Jean-Marc Lasgouttes wrote:
> > >> It looks correct to me, although I did not try it out. Georg, what
> > >> do you think?
> >
> > Georg> I did not look at the patch. I spent far too much time with
> > Georg> this stuff already, so I decided to have no opinion.
> >
> > Enrico, I propose that you apply it to 1.5 now (minus the
> > compatibility code for the old variable which is not really needed, I
> > think).
>
> I do not have commit privileges, so some kind soul should apply it.
> I mostly agree with you about the compatibility code, as lyxrc.defaults
> is automatically regenerated after an upgrade. But if someone changed
> the default, the old switch would be also in preferences and will not
> be recognized. I think that the compatibility code could be left in 1.4.x
> but removed in 1.5.x. After all, this code reduces to the following in
> src/lyxrc.C:
>
> + // compatibility with versions older than 1.4.2 only
> + { "\\cygwin_path_fix_needed", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
>
> I'll prepare an updated patch, though.
>
> > Then I would appreciate a 1.4.2 version, if you believe this is needed
> > for proper cygwin operation.
>
> Yes, I think that the fix about external_path is really needed, as it
> cannot depend on the checkbutton status. Then, the meaning of the switch
> is now more clear, I think.
>
> I'll also put together a patch for 1.4.2.
Please, find attached patches for both 1.5.0 and 1.4.2. I have removed
the compatibility code and tested both patches.
--
Enrico
Index: src/ChangeLog
===================================================================
--- src/ChangeLog (revision 14237)
+++ src/ChangeLog (working copy)
@@ -1,3 +1,12 @@
+2006-06-27 Enrico Forestieri <[EMAIL PROTECTED]>
+
+ * lyxrc.h: rename RC_CYGWIN_PATH_FIX as RC_TEX_EXPECTS_WINDOWS_PATHS
+ and cygwin_path_fix as windows_style_tex_paths.
+ * lyxfunc.C (actOnUpdatedPrefs): ditto.
+ * lyxrc.C: ditto; also rename \cygwin_path_fix_needed as
+ \tex_expects_windows_paths.
+ * lyx_main.C (init): rename cygwin_path_fix as windows_style_tex_paths.
+
2006-06-07 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* bufferparams.h: make author_map use an unsigned index, to avoid
Index: src/lyxfunc.C
===================================================================
--- src/lyxfunc.C (revision 14237)
+++ src/lyxfunc.C (working copy)
@@ -1972,11 +1972,6 @@
case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
case LyXRC::RC_CUSTOM_EXPORT_COMMAND:
case LyXRC::RC_CUSTOM_EXPORT_FORMAT:
- case LyXRC::RC_CYGWIN_PATH_FIX:
- if (lyxrc_orig.cygwin_path_fix != lyxrc_new.cygwin_path_fix) {
- namespace os = lyx::support::os;
- os::cygwin_path_fix(lyxrc_new.cygwin_path_fix);
- }
case LyXRC::RC_DATE_INSERT_FORMAT:
case LyXRC::RC_DEFAULT_LANGUAGE:
case LyXRC::RC_DEFAULT_PAPERSIZE:
@@ -2060,6 +2055,11 @@
case LyXRC::RC_TEMPDIRPATH:
case LyXRC::RC_TEMPLATEPATH:
case LyXRC::RC_TEX_ALLOWS_SPACES:
+ case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
+ if (lyxrc_orig.windows_style_tex_paths !=
lyxrc_new.windows_style_tex_paths) {
+ namespace os = lyx::support::os;
+
os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
+ }
case LyXRC::RC_UIFILE:
case LyXRC::RC_USER_EMAIL:
case LyXRC::RC_USER_NAME:
Index: src/frontends/qt2/QPrefs.C
===================================================================
--- src/frontends/qt2/QPrefs.C (revision 14237)
+++ src/frontends/qt2/QPrefs.C (working copy)
@@ -204,7 +204,7 @@
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
- rc.cygwin_path_fix = !cygwinmod->pathCB->isChecked();
+ rc.windows_style_tex_paths = cygwinmod->pathCB->isChecked();
#endif
QPrefLatexModule * latexmod(dialog_->latexModule);
@@ -546,7 +546,7 @@
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
- cygwinmod->pathCB->setChecked(!rc.cygwin_path_fix);
+ cygwinmod->pathCB->setChecked(rc.windows_style_tex_paths);
#endif
QPrefLatexModule * latexmod(dialog_->latexModule);
Index: src/frontends/qt2/ChangeLog
===================================================================
--- src/frontends/qt2/ChangeLog (revision 14237)
+++ src/frontends/qt2/ChangeLog (working copy)
@@ -1,3 +1,10 @@
+2006-06-27 Enrico Forestieri <[EMAIL PROTECTED]>
+
+ * QPrefs.C (apply, update_contents): rename cygwin_path_fix as
+ windows_style_tex_paths taking into account updated checkbutton label.
+
+ * ui/QPrefCygwinPathModule.ui: update checkbutton label and description.
+
2006-06-16 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* qfont_loader.[Ch]: use our own font width cache with Qt/Mac.
Index: src/frontends/qt2/ui/QPrefCygwinPathModule.ui
===================================================================
--- src/frontends/qt2/ui/QPrefCygwinPathModule.ui (revision 14237)
+++ src/frontends/qt2/ui/QPrefCygwinPathModule.ui (working copy)
@@ -63,7 +63,7 @@
</property>
<property stdset="1">
<name>text</name>
- <string>&Use Cygwin-style paths</string>
+ <string>&Use Windows-style paths in LaTeX files</string>
</property>
<property>
<name>toolTip</name>
@@ -71,7 +71,7 @@
</property>
<property>
<name>whatsThis</name>
- <string>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.</string>
+ <string>Select if LyX should output Windows-style paths rather
than Posix-style paths to LaTeX files. Useful if you're using the native
Windows MikTeX rather than the Cygwin teTeX.</string>
</property>
</widget>
</widget>
Index: src/frontends/xforms/FormPreferences.C
===================================================================
--- src/frontends/xforms/FormPreferences.C (revision 14237)
+++ src/frontends/xforms/FormPreferences.C (working copy)
@@ -2074,7 +2074,8 @@
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.windows_style_tex_paths =
+ fl_get_button(dialog_->check_windows_style_tex_paths);
#endif
}
@@ -2095,7 +2096,7 @@
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#else
- setEnabled(dialog_->check_cygwin_path, false);
+ setEnabled(dialog_->check_windows_style_tex_paths, false);
#endif
fl_addto_choice(dialog_->choice_default_papersize,
@@ -2113,7 +2114,7 @@
setPrehandler(dialog_->input_paperoption);
setPrehandler(dialog_->check_autoreset_classopt);
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
- setPrehandler(dialog_->check_cygwin_path);
+ setPrehandler(dialog_->check_windows_style_tex_paths);
#endif
}
@@ -2140,12 +2141,11 @@
if (ob == dialog_->check_autoreset_classopt)
return LyXRC::getDescription(LyXRC::RC_AUTORESET_OPTIONS);
#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.");
+ if (ob == dialog_->check_windows_style_tex_paths)
+ return _("Select if LyX should output Windows-style paths "
+ "rather than Posix-style paths to LaTeX files. "
+ "Useful if you're using the native Windows MikTeX "
+ "rather than the Cygwin teTeX.");
#endif
return string();
}
@@ -2172,7 +2172,8 @@
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_windows_style_tex_paths,
+ rc.windows_style_tex_paths);
#endif
}
Index: src/frontends/xforms/ChangeLog
===================================================================
--- src/frontends/xforms/ChangeLog (revision 14237)
+++ src/frontends/xforms/ChangeLog (working copy)
@@ -1,3 +1,13 @@
+2006-06-27 Enrico Forestieri <[EMAIL PROTECTED]>
+
+ * FormPreferences.C (apply): rename cygwin_path_fix as
+ windows_style_tex_paths.
+ (build): rename check_cygwin_path as check_windows_style_tex_paths.
+ (update): rename check_cygwin_path as check_windows_style_tex_paths.
+ (feedback): ditto, update checkbutton description.
+
+ * forms/form_preferences.fd: update label and name of checkbutton.
+
2006-03-22 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* FormDocument.C (options_apply): do not return a bool anymore
Index: src/frontends/xforms/forms/form_preferences.fd
===================================================================
--- src/frontends/xforms/forms/form_preferences.fd (revision 14237)
+++ src/frontends/xforms/forms/form_preferences.fd (working copy)
@@ -3131,11 +3131,11 @@
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Use Cygwin Paths|#s
+label: Use Windows Paths for LaTeX|#s
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: check_cygwin_path
+name: check_windows_style_tex_paths
callback: C_FormDialogView_InputCB
argument: 0
Index: src/support/os_unix.C
===================================================================
--- src/support/os_unix.C (revision 14237)
+++ src/support/os_unix.C (working copy)
@@ -116,7 +116,7 @@
}
-void cygwin_path_fix(bool)
+void windows_style_tex_paths(bool)
{}
bool canAutoOpenFile(string const & ext, auto_open_mode const mode)
Index: src/support/os.h
===================================================================
--- src/support/os.h (revision 14237)
+++ src/support/os.h (working copy)
@@ -74,11 +74,11 @@
*/
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
+/** If @c use_windows_paths is true, LyX will output Windows-style paths to
+ * latex files rather than posix ones. Currently, this option is used only
* under Cygwin.
*/
-void cygwin_path_fix(bool use_cygwin_paths);
+void windows_style_tex_paths(bool use_windows_paths);
enum auto_open_mode {
VIEW,
Index: src/support/os_win32.C
===================================================================
--- src/support/os_win32.C (revision 14237)
+++ src/support/os_win32.C (working copy)
@@ -282,7 +282,7 @@
}
-void cygwin_path_fix(bool)
+void windows_style_tex_paths(bool)
{}
Index: src/support/ChangeLog
===================================================================
--- src/support/ChangeLog (revision 14237)
+++ src/support/ChangeLog (working copy)
@@ -1,3 +1,11 @@
+2006-06-27 Enrico Forestieri <[EMAIL PROTECTED]>
+
+ * os.h: rename cygwin_path_fix as windows_style_tex_paths.
+
+ * os_*.C: rename cygwin_path_fix as windows_style_tex_paths.
+ * os_cygwin.C (external_path, external_path_list): make returned
+ path-style independent of checkbutton for latex path-styles.
+
2006-06-14 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* gzstream.h: do not test for HAVE_ZLIB_H, since we require it
Index: src/support/os_cygwin.C
===================================================================
--- src/support/os_cygwin.C (revision 14237)
+++ src/support/os_cygwin.C (working copy)
@@ -39,7 +39,7 @@
namespace {
-bool cygwin_path_fix_ = false;
+bool windows_style_tex_paths_ = false;
// In both is_posix_path() and is_windows_path() it is assumed that
// a valid posix or pseudo-windows path is passed. They simply tell
@@ -186,8 +186,7 @@
string external_path(string const & p)
{
- return convert_path(p, cygwin_path_fix_ ? PathStyle(windows)
- : PathStyle(posix));
+ return convert_path(p, PathStyle(windows));
}
@@ -199,8 +198,7 @@
string external_path_list(string const & p)
{
- return convert_path_list(p, cygwin_path_fix_ ? PathStyle(windows)
- : PathStyle(posix));
+ return convert_path_list(p, PathStyle(windows));
}
@@ -213,13 +211,13 @@
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.
+ // on windows_style_tex_paths_), but we use always forward slashes,
+ // since it gets written into a .tex file.
- if (cygwin_path_fix_ && is_absolute_path(p)) {
+ if (windows_style_tex_paths_ && is_absolute_path(p)) {
string dos_path = convert_path(p, PathStyle(windows));
lyxerr[Debug::LATEX]
- << "<Cygwin path correction> ["
+ << "<Path correction for LaTeX> ["
<< p << "]->>["
<< dos_path << ']' << endl;
return dos_path;
@@ -268,9 +266,9 @@
}
-void cygwin_path_fix(bool use_cygwin_paths)
+void windows_style_tex_paths(bool use_windows_paths)
{
- cygwin_path_fix_ = use_cygwin_paths;
+ windows_style_tex_paths_ = use_windows_paths;
}
@@ -298,8 +296,7 @@
{
// reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc
// /platform/shell/reference/functions/shellexecute.asp
- string const win_path =
- os::convert_path(filename, os::PathStyle(os::windows));
+ string const win_path = convert_path(filename, PathStyle(windows));
char const * action = (mode == VIEW) ? "open" : "edit";
return reinterpret_cast<int>(ShellExecute(NULL, action,
win_path.c_str(), NULL, NULL, 1)) > 32;
Index: src/support/os_os2.C
===================================================================
--- src/support/os_os2.C (revision 14237)
+++ src/support/os_os2.C (working copy)
@@ -209,7 +209,7 @@
}
-void cygwin_path_fix(bool)
+void windows_style_tex_paths(bool)
{}
} // namespace os
Index: src/lyxrc.C
===================================================================
--- src/lyxrc.C (revision 14237)
+++ src/lyxrc.C (working copy)
@@ -80,7 +80,6 @@
{ "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
{ "\\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 },
{ "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
{ "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
{ "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
@@ -159,6 +158,7 @@
{ "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
{ "\\template_path", LyXRC::RC_TEMPLATEPATH },
{ "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
+ { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
{ "\\ui_file", LyXRC::RC_UIFILE },
{ "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
{ "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
@@ -270,7 +270,7 @@
language_command_local = "\\foreignlanguage{$$lang}{";
default_language = "english";
show_banner = true;
- cygwin_path_fix = false;
+ windows_style_tex_paths = false;
tex_allows_spaces = false;
date_insert_format = "%A, %e %B %Y";
cursor_follows_scrollbar = false;
@@ -388,9 +388,9 @@
}
break;
- case RC_CYGWIN_PATH_FIX:
+ case RC_TEX_EXPECTS_WINDOWS_PATHS:
if (lexrc.next()) {
- cygwin_path_fix = lexrc.getBool();
+ windows_style_tex_paths = lexrc.getBool();
}
break;
@@ -1330,11 +1330,11 @@
index_command != system_lyxrc.index_command) {
os << "\\index_command \"" << index_command << "\"\n";
}
- case RC_CYGWIN_PATH_FIX:
+ case RC_TEX_EXPECTS_WINDOWS_PATHS:
if (ignore_system_lyxrc ||
- cygwin_path_fix != system_lyxrc.cygwin_path_fix) {
- os << "\\cygwin_path_fix_needed "
- << convert<string>(cygwin_path_fix) << '\n';
+ windows_style_tex_paths !=
system_lyxrc.windows_style_tex_paths) {
+ os << "\\tex_expects_windows_paths "
+ << convert<string>(windows_style_tex_paths) << '\n';
}
case RC_TEX_ALLOWS_SPACES:
if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
@@ -2130,9 +2130,6 @@
case RC_CUSTOM_EXPORT_FORMAT:
break;
- case RC_CYGWIN_PATH_FIX:
- break;
-
case RC_DATE_INSERT_FORMAT:
//xgettext:no-c-format
str = _("This accepts the normal strftime formats; see man
strftime for full details. E.g.\"%A, %e. %B %Y\".");
@@ -2401,6 +2398,9 @@
str = _("The path that LyX will set when offering to choose a
template. An empty value selects the directory LyX was started from.");
break;
+ case RC_TEX_EXPECTS_WINDOWS_PATHS:
+ break;
+
case RC_TEX_ALLOWS_SPACES:
break;
Index: src/lyxrc.h
===================================================================
--- src/lyxrc.h (revision 14237)
+++ src/lyxrc.h (working copy)
@@ -51,7 +51,6 @@
RC_CURSOR_FOLLOWS_SCROLLBAR,
RC_CUSTOM_EXPORT_COMMAND,
RC_CUSTOM_EXPORT_FORMAT,
- RC_CYGWIN_PATH_FIX,
RC_DATE_INSERT_FORMAT,
RC_DEFAULT_LANGUAGE,
RC_DEFAULT_PAPERSIZE,
@@ -124,6 +123,7 @@
RC_TEMPDIRPATH,
RC_TEMPLATEPATH,
RC_TEX_ALLOWS_SPACES,
+ RC_TEX_EXPECTS_WINDOWS_PATHS,
RC_UIFILE,
RC_USER_EMAIL,
RC_USER_NAME,
@@ -376,8 +376,8 @@
std::string user_name;
/// user email
std::string user_email;
- ///
- bool cygwin_path_fix;
+ /// True if the TeX engine cannot handle posix paths
+ bool windows_style_tex_paths;
/// True if the TeX engine can handle file names containing spaces
bool tex_allows_spaces;
/** Prepend paths to the PATH environment variable.
Index: src/lyx_main.C
===================================================================
--- src/lyx_main.C (revision 14237)
+++ src/lyx_main.C (working copy)
@@ -502,7 +502,7 @@
if (lyxerr.debugging(Debug::LYXRC))
lyxrc.print();
- os::cygwin_path_fix(lyxrc.cygwin_path_fix);
+ os::windows_style_tex_paths(lyxrc.windows_style_tex_paths);
if (!lyxrc.path_prefix.empty())
prependEnvPath("PATH", lyxrc.path_prefix);
Index: lib/ChangeLog
===================================================================
--- lib/ChangeLog (revision 14237)
+++ lib/ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2006-06-27 Enrico Forestieri <[EMAIL PROTECTED]>
+
+ * configure.py: rename checkCygwinPath -> checkTeXPaths,
+ cygwin_path_fix -> windows_style_tex_paths,
+ \cygwin_path_fix_needed -> \tex_expects_windows_paths.
+
2006-06-01 Panayotis Papasotiriou <[EMAIL PROTECTED]>
* Makefile.am:
Index: lib/configure.py
===================================================================
--- lib/configure.py (revision 14237)
+++ lib/configure.py (working copy)
@@ -78,9 +78,9 @@
sys.exit(1)
-def checkCygwinPath(srcdir):
- ''' Adjust PATH for Win32 (Cygwin) '''
- cygwin_path_fix = ''
+def checkTeXPaths():
+ ''' Determine the path-style needed by the TeX engine on Win32 (Cygwin) '''
+ windows_style_tex_paths = ''
if sys.platform == 'cygwin':
from tempfile import mkstemp
fd, tmpfname = mkstemp(suffix='.ltx', dir='/tmp')
@@ -96,18 +96,16 @@
os.write(wfd, r'\input{' + inpname + '}' )
os.close(wfd)
if cmdOutput('latex ' + wtmpfname).find('Error') != -1:
- print "configure: cygwin detected; path correction is not needed"
- cygwin_path_fix = 'false'
+ print "configure: TeX engine needs posix-style paths in latex files"
+ windows_style_tex_paths = 'false'
else:
- print "configure: cygwin detected; path correction"
- srcdir = cmdOutput('cygpath -m ' + srcdir)
- print "srcdir = ", srcdir
- cygwin_path_fix = 'true'
+ print "configure: TeX engine needs windows-style paths in latex files"
+ windows_style_tex_paths = 'true'
tmpbname,ext = os.path.splitext(os.path.basename(tmpfname))
wtmpbname,ext = os.path.splitext(os.path.basename(wtmpfname))
removeFiles( [ tmpfname, wtmpfname, tmpbname + '.log', \
tmpbname + '.aux', wtmpbname + '.log', wtmpbname + '.aux' ] )
- return cygwin_path_fix
+ return windows_style_tex_paths
## Searching some useful programs
@@ -698,7 +696,7 @@
sys.exit(1)
setEnviron()
createDirectories()
- cygwin_path_fix = checkCygwinPath(srcdir)
+ windows_style_tex_paths = checkTeXPaths()
## Write the first part of outfile
writeToFile(outfile, '''# This file has been automatically generated by LyX'
lib/configure.py
# script. It contains default settings that have been determined by
@@ -714,9 +712,9 @@
(chk_linuxdoc, bool_linuxdoc, linuxdoc_cmd) = checkLinuxDoc()
(chk_docbook, bool_docbook, docbook_cmd) = checkDocBook()
checkTeXAllowSpaces()
+ if windows_style_tex_paths != '':
+ addToRC(r'\tex_expects_windows_paths %s' % windows_style_tex_paths)
checkOtherEntries()
- if cygwin_path_fix != '':
- addToRC(r'\cygwin_path_fix_needed %s' % cygwin_path_fix)
# --without-latex-config can disable lyx_check_config
checkLatexConfig( lyx_check_config and LATEX != '', bool_docbook,
bool_linuxdoc)
createLaTeXConfig()
Index: src/lyxfunc.C
===================================================================
--- src/lyxfunc.C (revision 14237)
+++ src/lyxfunc.C (working copy)
@@ -1990,11 +1990,6 @@
case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
case LyXRC::RC_CUSTOM_EXPORT_COMMAND:
case LyXRC::RC_CUSTOM_EXPORT_FORMAT:
- case LyXRC::RC_CYGWIN_PATH_FIX:
- if (lyxrc_orig.cygwin_path_fix != lyxrc_new.cygwin_path_fix) {
- namespace os = lyx::support::os;
- os::cygwin_path_fix(lyxrc_new.cygwin_path_fix);
- }
case LyXRC::RC_DATE_INSERT_FORMAT:
case LyXRC::RC_DEFAULT_LANGUAGE:
case LyXRC::RC_DEFAULT_PAPERSIZE:
@@ -2080,6 +2075,11 @@
case LyXRC::RC_TEMPDIRPATH:
case LyXRC::RC_TEMPLATEPATH:
case LyXRC::RC_TEX_ALLOWS_SPACES:
+ case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
+ if (lyxrc_orig.windows_style_tex_paths !=
lyxrc_new.windows_style_tex_paths) {
+ namespace os = lyx::support::os;
+
os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
+ }
case LyXRC::RC_UIFILE:
case LyXRC::RC_USER_EMAIL:
case LyXRC::RC_USER_NAME:
Index: src/frontends/qt3/QPrefs.C
===================================================================
--- src/frontends/qt3/QPrefs.C (revision 14237)
+++ src/frontends/qt3/QPrefs.C (working copy)
@@ -23,7 +23,7 @@
#include "ui/QPrefLatexModule.h"
#include "ui/QPrefScreenFontsModule.h"
#include "ui/QPrefColorsModule.h"
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
#include "ui/QPrefCygwinPathModule.h"
#endif
#include "ui/QPrefDisplayModule.h"
@@ -204,9 +204,9 @@
rc.date_insert_format = fromqstr(datemod->DateED->text());
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
- rc.cygwin_path_fix = !cygwinmod->pathCB->isChecked();
+ rc.windows_style_tex_paths = cygwinmod->pathCB->isChecked();
#endif
QPrefLatexModule * latexmod(dialog_->latexModule);
@@ -548,9 +548,9 @@
datemod->DateED->setText(toqstr(rc.date_insert_format));
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
QPrefCygwinPathModule * cygwinmod(dialog_->cygwinpathModule);
- cygwinmod->pathCB->setChecked(!rc.cygwin_path_fix);
+ cygwinmod->pathCB->setChecked(rc.windows_style_tex_paths);
#endif
QPrefLatexModule * latexmod(dialog_->latexModule);
Index: src/frontends/qt3/QPrefsDialog.C
===================================================================
--- src/frontends/qt3/QPrefsDialog.C (revision 14237)
+++ src/frontends/qt3/QPrefsDialog.C (working copy)
@@ -27,7 +27,7 @@
#include "ui/QPrefLatexModule.h"
#include "ui/QPrefScreenFontsModule.h"
#include "ui/QPrefColorsModule.h"
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
#include "ui/QPrefCygwinPathModule.h"
#endif
#include "ui/QPrefDisplayModule.h"
@@ -79,7 +79,7 @@
latexModule = new QPrefLatexModule(this);
screenfontsModule = new QPrefScreenFontsModule(this);
colorsModule = new QPrefColorsModule(this);
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
cygwinpathModule = new QPrefCygwinPathModule(this);
#endif
displayModule = new QPrefDisplayModule(this);
@@ -111,7 +111,7 @@
prefsPS->addPanel(asciiModule, _("Plain text"), op);
prefsPS->addPanel(dateModule, _("Date format"), op);
prefsPS->addPanel(latexModule, _("LaTeX"), op);
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
prefsPS->addPanel(cygwinpathModule, _("Paths"), op);
#endif
prefsPS->addPanel(printerModule, _("Printer"), op);
@@ -243,7 +243,7 @@
connect(asciiModule->asciiLinelengthSB, SIGNAL(valueChanged(int)),
this, SLOT(change_adaptor()));
connect(asciiModule->asciiRoffED, SIGNAL(textChanged(const QString&)),
this, SLOT(change_adaptor()));
connect(dateModule->DateED, SIGNAL(textChanged(const QString&)), this,
SLOT(change_adaptor()));
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
connect(cygwinpathModule->pathCB, SIGNAL(toggled(bool)), this,
SLOT(change_adaptor()));
#endif
connect(latexModule->latexEncodingED, SIGNAL(textChanged(const
QString&)), this, SLOT(change_adaptor()));
Index: src/frontends/qt3/ui/QPrefCygwinPathModule.ui
===================================================================
--- src/frontends/qt3/ui/QPrefCygwinPathModule.ui (revision 14237)
+++ src/frontends/qt3/ui/QPrefCygwinPathModule.ui (working copy)
@@ -31,13 +31,13 @@
</rect>
</property>
<property name="text">
- <string>&Use Cygwin-style paths</string>
+ <string>&Use Windows-style paths in LaTeX files</string>
</property>
<property name="toolTip" stdset="0">
<string></string>
</property>
<property name="whatsThis" stdset="0">
- <string>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.</string>
+ <string>Select if LyX should output Windows-style paths rather
than Posix-style paths to LaTeX files. Useful if you're using the native
Windows MikTeX rather than the Cygwin teTeX.</string>
</property>
</widget>
<spacer>
Index: src/frontends/qt3/QPrefsDialog.h
===================================================================
--- src/frontends/qt3/QPrefsDialog.h (revision 14237)
+++ src/frontends/qt3/QPrefsDialog.h (working copy)
@@ -110,7 +110,7 @@
QPrefLatexModule * latexModule;
QPrefScreenFontsModule * screenfontsModule;
QPrefColorsModule * colorsModule;
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
QPrefCygwinPathModule * cygwinpathModule;
#endif
QPrefDisplayModule * displayModule;
Index: src/frontends/qt4/QPrefsDialog.C
===================================================================
--- src/frontends/qt4/QPrefsDialog.C (revision 14237)
+++ src/frontends/qt4/QPrefsDialog.C (working copy)
@@ -576,13 +576,13 @@
void PrefCygwinPath::apply(LyXRC & rc) const
{
- rc.cygwin_path_fix = pathCB->isChecked();
+ rc.windows_style_tex_paths = pathCB->isChecked();
}
void PrefCygwinPath::update(LyXRC const & rc)
{
- pathCB->setChecked(rc.cygwin_path_fix);
+ pathCB->setChecked(rc.windows_style_tex_paths);
}
@@ -1801,7 +1801,7 @@
add(new PrefScreenFonts(form_));
add(new PrefColors(form_));
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
add(new PrefCygwinPath);
#endif
Index: src/frontends/qt4/ui/QPrefCygwinPathUi.ui
===================================================================
--- src/frontends/qt4/ui/QPrefCygwinPathUi.ui (revision 14237)
+++ src/frontends/qt4/ui/QPrefCygwinPathUi.ui (working copy)
@@ -31,10 +31,10 @@
<string/>
</property>
<property name="whatsThis" >
- <string>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.</string>
+ <string>Select if LyX should output Windows-style paths rather than
Posix-style paths to LaTeX files. Useful if you're using the native Windows
MikTeX rather than the Cygwin teTeX.</string>
</property>
<property name="text" >
- <string>&Use Cygwin-style paths</string>
+ <string>&Use Windows-style paths in LaTeX files</string>
</property>
</widget>
</widget>
Index: src/frontends/xforms/FormPreferences.C
===================================================================
--- src/frontends/xforms/FormPreferences.C (revision 14237)
+++ src/frontends/xforms/FormPreferences.C (working copy)
@@ -2085,8 +2085,9 @@
rc.view_dvi_paper_option = getString(dialog_->input_paperoption);
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);
+#if defined(__CYGWIN__) || defined(_WIN32)
+ rc.windows_style_tex_paths =
+ fl_get_button(dialog_->check_windows_style_tex_paths);
#endif
}
@@ -2105,9 +2106,9 @@
fl_set_input_return(dialog_->input_index, FL_RETURN_CHANGED);
fl_set_input_return(dialog_->input_paperoption, FL_RETURN_CHANGED);
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if defined(__CYGWIN__) || defined(_WIN32)
#else
- setEnabled(dialog_->check_cygwin_path, false);
+ setEnabled(dialog_->check_windows_style_tex_paths, false);
#endif
fl_addto_choice(dialog_->choice_default_papersize,
@@ -2124,8 +2125,8 @@
setPrehandler(dialog_->input_index);
setPrehandler(dialog_->input_paperoption);
setPrehandler(dialog_->check_autoreset_classopt);
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
- setPrehandler(dialog_->check_cygwin_path);
+#if defined(__CYGWIN__) || defined(_WIN32)
+ setPrehandler(dialog_->check_windows_style_tex_paths);
#endif
}
@@ -2151,13 +2152,12 @@
return LyXRC::getDescription(LyXRC::RC_VIEWDVI_PAPEROPTION);
if (ob == dialog_->check_autoreset_classopt)
return LyXRC::getDescription(LyXRC::RC_AUTORESET_OPTIONS);
-#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.");
+#if defined(__CYGWIN__) || defined(_WIN32)
+ if (ob == dialog_->check_windows_style_tex_paths)
+ return _("Select if LyX should output Windows-style paths "
+ "rather than Posix-style paths to LaTeX files. "
+ "Useful if you're using the native Windows MikTeX "
+ "rather than the Cygwin teTeX.");
#endif
return string();
}
@@ -2183,8 +2183,9 @@
rc.view_dvi_paper_option.c_str());
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);
+#if defined(__CYGWIN__) || defined(_WIN32)
+ fl_set_button(dialog_->check_windows_style_tex_paths,
+ rc.windows_style_tex_paths);
#endif
}
Index: src/frontends/xforms/forms/form_preferences.fd
===================================================================
--- src/frontends/xforms/forms/form_preferences.fd (revision 14237)
+++ src/frontends/xforms/forms/form_preferences.fd (working copy)
@@ -3149,11 +3149,11 @@
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Use Cygwin Paths|#s
+label: Use Windows Paths for LaTeX|#s
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: check_cygwin_path
+name: check_windows_style_tex_paths
callback: C_FormDialogView_InputCB
argument: 0
Index: src/support/os_unix.C
===================================================================
--- src/support/os_unix.C (revision 14237)
+++ src/support/os_unix.C (working copy)
@@ -116,7 +116,7 @@
}
-void cygwin_path_fix(bool)
+void windows_style_tex_paths(bool)
{}
bool canAutoOpenFile(string const & ext, auto_open_mode const mode)
Index: src/support/os.h
===================================================================
--- src/support/os.h (revision 14237)
+++ src/support/os.h (working copy)
@@ -74,11 +74,11 @@
*/
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 use_windows_paths is true, LyX will output Windows-style paths to
+ * latex files rather than posix ones. Obviously, this option is used only
+ * under Windows.
*/
-void cygwin_path_fix(bool use_cygwin_paths);
+void windows_style_tex_paths(bool use_windows_paths);
enum auto_open_mode {
VIEW,
Index: src/support/os_win32.C
===================================================================
--- src/support/os_win32.C (revision 14237)
+++ src/support/os_win32.C (working copy)
@@ -76,7 +76,7 @@
namespace {
-bool cygwin_path_fix_ = false;
+bool windows_style_tex_paths_ = true;
string cygdrive = "/cygdrive";
@@ -260,15 +260,15 @@
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.
+ // on windows_style_tex_paths_), but we use always forward slashes,
+ // since it gets written into a .tex file.
- if (cygwin_path_fix_ && is_absolute_path(p)) {
+ if (!windows_style_tex_paths_ && is_absolute_path(p)) {
string const drive = p.substr(0, 2);
string const cygprefix = cygdrive + "/" + drive.substr(0, 1);
string const cygpath = subst(subst(p, '\\', '/'), drive,
cygprefix);
lyxerr[Debug::LATEX]
- << "<Cygwin path correction> ["
+ << "<Path correction for LaTeX> ["
<< p << "]->>["
<< cygpath << ']' << endl;
return cygpath;
@@ -322,9 +322,9 @@
}
-void cygwin_path_fix(bool use_cygwin_paths)
+void windows_style_tex_paths(bool use_windows_paths)
{
- cygwin_path_fix_ = !use_cygwin_paths;
+ windows_style_tex_paths_ = use_windows_paths;
}
Index: src/support/os_cygwin.C
===================================================================
--- src/support/os_cygwin.C (revision 14237)
+++ src/support/os_cygwin.C (working copy)
@@ -39,7 +39,7 @@
namespace {
-bool cygwin_path_fix_ = false;
+bool windows_style_tex_paths_ = false;
// In both is_posix_path() and is_windows_path() it is assumed that
// a valid posix or pseudo-windows path is passed. They simply tell
@@ -186,8 +186,7 @@
string external_path(string const & p)
{
- return convert_path(p, cygwin_path_fix_ ? PathStyle(windows)
- : PathStyle(posix));
+ return convert_path(p, PathStyle(windows));
}
@@ -199,8 +198,7 @@
string external_path_list(string const & p)
{
- return convert_path_list(p, cygwin_path_fix_ ? PathStyle(windows)
- : PathStyle(posix));
+ return convert_path_list(p, PathStyle(windows));
}
@@ -213,13 +211,13 @@
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.
+ // on windows_style_tex_paths_), but we use always forward slashes,
+ // since it gets written into a .tex file.
- if (cygwin_path_fix_ && is_absolute_path(p)) {
+ if (windows_style_tex_paths_ && is_absolute_path(p)) {
string dos_path = convert_path(p, PathStyle(windows));
lyxerr[Debug::LATEX]
- << "<Cygwin path correction> ["
+ << "<Path correction for LaTeX> ["
<< p << "]->>["
<< dos_path << ']' << endl;
return dos_path;
@@ -268,9 +266,9 @@
}
-void cygwin_path_fix(bool use_cygwin_paths)
+void windows_style_tex_paths(bool use_windows_paths)
{
- cygwin_path_fix_ = use_cygwin_paths;
+ windows_style_tex_paths_ = use_windows_paths;
}
@@ -295,8 +293,7 @@
{
// reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc
// /platform/shell/reference/functions/shellexecute.asp
- string const win_path =
- os::convert_path(filename, os::PathStyle(os::windows));
+ string const win_path = convert_path(filename, PathStyle(windows));
char const * action = (mode == VIEW) ? "open" : "edit";
return reinterpret_cast<int>(ShellExecute(NULL, action,
win_path.c_str(), NULL, NULL, 1)) > 32;
Index: src/lyxrc.C
===================================================================
--- src/lyxrc.C (revision 14237)
+++ src/lyxrc.C (working copy)
@@ -81,7 +81,6 @@
{ "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
{ "\\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 },
{ "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
{ "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
{ "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
@@ -163,6 +162,7 @@
{ "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
{ "\\template_path", LyXRC::RC_TEMPLATEPATH },
{ "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
+ { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
{ "\\ui_file", LyXRC::RC_UIFILE },
{ "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
{ "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
@@ -280,7 +280,7 @@
language_command_local = "\\foreignlanguage{$$lang}{";
default_language = "english";
show_banner = true;
- cygwin_path_fix = false;
+ windows_style_tex_paths = false;
tex_allows_spaces = false;
date_insert_format = "%A, %e %B %Y";
cursor_follows_scrollbar = false;
@@ -398,9 +398,9 @@
}
break;
- case RC_CYGWIN_PATH_FIX:
+ case RC_TEX_EXPECTS_WINDOWS_PATHS:
if (lexrc.next()) {
- cygwin_path_fix = lexrc.getBool();
+ windows_style_tex_paths = lexrc.getBool();
}
break;
@@ -1374,11 +1374,11 @@
index_command != system_lyxrc.index_command) {
os << "\\index_command \"" << index_command << "\"\n";
}
- case RC_CYGWIN_PATH_FIX:
+ case RC_TEX_EXPECTS_WINDOWS_PATHS:
if (ignore_system_lyxrc ||
- cygwin_path_fix != system_lyxrc.cygwin_path_fix) {
- os << "\\cygwin_path_fix_needed "
- << convert<string>(cygwin_path_fix) << '\n';
+ windows_style_tex_paths !=
system_lyxrc.windows_style_tex_paths) {
+ os << "\\tex_expects_windows_paths "
+ << convert<string>(windows_style_tex_paths) << '\n';
}
case RC_TEX_ALLOWS_SPACES:
if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
@@ -2203,9 +2203,6 @@
case RC_CUSTOM_EXPORT_FORMAT:
break;
- case RC_CYGWIN_PATH_FIX:
- break;
-
case RC_DATE_INSERT_FORMAT:
//xgettext:no-c-format
str = _("This accepts the normal strftime formats; see man
strftime for full details. E.g.\"%A, %e. %B %Y\".");
@@ -2490,6 +2487,9 @@
case RC_TEX_ALLOWS_SPACES:
break;
+ case RC_TEX_EXPECTS_WINDOWS_PATHS:
+ break;
+
case RC_UIFILE:
str = _("The UI (user interface) file. Can either specify an
absolute path, or LyX will look in its global and local ui/ directories.");
break;
Index: src/lyxrc.h
===================================================================
--- src/lyxrc.h (revision 14237)
+++ src/lyxrc.h (working copy)
@@ -51,7 +51,6 @@
RC_CURSOR_FOLLOWS_SCROLLBAR,
RC_CUSTOM_EXPORT_COMMAND,
RC_CUSTOM_EXPORT_FORMAT,
- RC_CYGWIN_PATH_FIX,
RC_DATE_INSERT_FORMAT,
RC_DEFAULT_LANGUAGE,
RC_DEFAULT_PAPERSIZE,
@@ -128,6 +127,7 @@
RC_TEMPDIRPATH,
RC_TEMPLATEPATH,
RC_TEX_ALLOWS_SPACES,
+ RC_TEX_EXPECTS_WINDOWS_PATHS,
RC_UIFILE,
RC_USER_EMAIL,
RC_USER_NAME,
@@ -389,8 +389,8 @@
std::string user_name;
/// user email
std::string user_email;
- ///
- bool cygwin_path_fix;
+ /// True if the TeX engine cannot handle posix paths
+ bool windows_style_tex_paths;
/// True if the TeX engine can handle file names containing spaces
bool tex_allows_spaces;
/** Prepend paths to the PATH environment variable.
Index: src/lyx_main.C
===================================================================
--- src/lyx_main.C (revision 14237)
+++ src/lyx_main.C (working copy)
@@ -545,7 +545,7 @@
if (lyxerr.debugging(Debug::LYXRC))
lyxrc.print();
- os::cygwin_path_fix(lyxrc.cygwin_path_fix);
+ os::windows_style_tex_paths(lyxrc.windows_style_tex_paths);
if (!lyxrc.path_prefix.empty())
prependEnvPath("PATH", lyxrc.path_prefix);
Index: lib/configure.py
===================================================================
--- lib/configure.py (revision 14237)
+++ lib/configure.py (working copy)
@@ -78,38 +78,38 @@
sys.exit(1)
-def checkCygwinPath(srcdir):
- ''' Adjust PATH for Win32 (Cygwin) '''
- cygwin_path_fix = ''
- if os.name == 'nt':
- cygwin_path_fix = 'true'
- elif sys.platform == 'cygwin':
+def checkTeXPaths():
+ ''' Determine the path-style needed by the TeX engine on Win32 (Cygwin) '''
+ windows_style_tex_paths = ''
+ if os.name == 'nt' or sys.platform == 'cygwin':
from tempfile import mkstemp
- fd, tmpfname = mkstemp(suffix='.ltx', dir='/tmp')
+ fd, tmpfname = mkstemp(suffix='.ltx')
+ # a wrapper file
+ wfd, wtmpfname = mkstemp(suffix='.ltx')
+ if os.name == 'nt':
+ inpname = tmpfname.replace('\\', '/')
+ wtmpfname = wtmpfname.replace('\\', '/')
+ else:
+ inpname = cmdOutput('cygpath -m ' + tmpfname)
+ wtmpfname = cmdOutput('cygpath -m ' + wtmpfname)
os.write(fd, r'''
\documentstyle{article}
\begin{document}\end{document}
''')
os.close(fd)
- inpname = cmdOutput('cygpath -m ' + tmpfname)
- # a wrapper file
- wfd, wtmpfname = mkstemp(suffix='.ltx', dir='/tmp')
- wtmpfname = cmdOutput('cygpath -m ' + wtmpfname)
- os.write(wfd, r'\input{' + inpname + '}' )
+ os.write(wfd, r'\input{' + inpname.replace('~', '\\string~') + '}' )
os.close(wfd)
if cmdOutput('latex ' + wtmpfname).find('Error') != -1:
- print "configure: cygwin detected; path correction is not needed"
- cygwin_path_fix = 'false'
+ print "configure: TeX engine needs posix-style paths in latex files"
+ windows_style_tex_paths = 'false'
else:
- print "configure: cygwin detected; path correction"
- srcdir = cmdOutput('cygpath -m ' + srcdir)
- print "srcdir = ", srcdir
- cygwin_path_fix = 'true'
+ print "configure: TeX engine needs windows-style paths in latex files"
+ windows_style_tex_paths = 'true'
tmpbname,ext = os.path.splitext(os.path.basename(tmpfname))
wtmpbname,ext = os.path.splitext(os.path.basename(wtmpfname))
removeFiles( [ tmpfname, wtmpfname, tmpbname + '.log', \
tmpbname + '.aux', wtmpbname + '.log', wtmpbname + '.aux' ] )
- return cygwin_path_fix
+ return windows_style_tex_paths
## Searching some useful programs
@@ -700,7 +700,7 @@
sys.exit(1)
setEnviron()
createDirectories()
- cygwin_path_fix = checkCygwinPath(srcdir)
+ windows_style_tex_paths = checkTeXPaths()
## Write the first part of outfile
writeToFile(outfile, '''# This file has been automatically generated by LyX'
lib/configure.py
# script. It contains default settings that have been determined by
@@ -716,9 +716,9 @@
(chk_linuxdoc, bool_linuxdoc, linuxdoc_cmd) = checkLinuxDoc()
(chk_docbook, bool_docbook, docbook_cmd) = checkDocBook()
checkTeXAllowSpaces()
+ if windows_style_tex_paths != '':
+ addToRC(r'\tex_expects_windows_paths %s' % windows_style_tex_paths)
checkOtherEntries()
- if cygwin_path_fix != '':
- addToRC(r'\cygwin_path_fix_needed %s' % cygwin_path_fix)
# --without-latex-config can disable lyx_check_config
checkLatexConfig( lyx_check_config and LATEX != '', bool_docbook,
bool_linuxdoc)
createLaTeXConfig()
Log:
Renaming:
cygwin_path_fix -> windows_style_tex_paths
cygwin_path_fix_needed -> tex_expects_windows_paths
check_cygwin_path -> check_windows_style_tex_paths
use_cygwin_paths -> use_windows_paths
RC_CYGWIN_PATH_FIX -> RC_TEX_EXPECTS_WINDOWS_PATHS
* src/frontends/qt4/ui/QPrefCygwinPathUi.ui
* src/frontends/qt3/ui/QPrefCygwinPathModule.ui
Updated checkbutton label and description
* src/frontends/qt4/QPrefsDialog.C
(PrefCygwinPath): cygwin_path_fix -> windows_style_tex_paths
(QPrefsDialog): Enable checkbutton for native WIN32 builds
* src/frontends/xforms/forms/form_preferences.fd
Updated label and name of checkbutton
* src/frontends/xforms/FormPreferences.C
(apply): cygwin_path_fix -> windows_style_tex_paths
check_cygwin_path -> check_windows_style_tex_paths
(build): Enable checkbutton for native WIN32 builds
(update): Ditto
(feedback): Updated description
* src/frontends/qt3/QPrefs.C
* src/frontends/qt3/QPrefsDialog.C
* src/frontends/qt3/QPrefsDialog.h
Renaming as above, enabled checkbutton for native WIN32 builds
* src/support/os_unix.C
* src/support/os.h
* src/support/os_win32.C
Renaming cygwin_path_fix -> windows_style_tex_paths
* src/support/os_cygwin.C
Ditto
(external_path, external_path_list): always return windows
style paths, not depending on the checkbutton status
* src/lyxrc.C
* src/lyxrc.h
* src/lyxfunc.C
* src/lyx_main.C
Renaming
* lib/configure.py
Renaming, more meaningful diagnostics