>>>>> "Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:
Bennett> I've fiddled around with things a bit, and discovered that Bennett> simply deleting the "eval" before "${LATEX}" in configure Bennett> works. Thanks a lot! This [eval] has nothing to do here, indeed. Does this mean that the following patch works? Any additional bug that comes to your mind? JMarc
Index: lib/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v retrieving revision 1.363.2.100 diff -u -p -r1.363.2.100 ChangeLog --- lib/ChangeLog 7 Mar 2005 13:53:19 -0000 1.363.2.100 +++ lib/ChangeLog 22 Mar 2005 15:18:10 -0000 @@ -1,3 +1,8 @@ +2005-03-22 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * configure.m4: add a check to see whether TeX allows spaces in + file names. Support requires web2c 7.5.3 or later. + 2005-02-26 Michael Schmitt <[EMAIL PROTECTED]> * ui/default.ui: change "BibTeX Reference..." to "BibTeX Bibliography..."; Index: lib/configure.m4 =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v retrieving revision 1.60.2.16 diff -u -p -r1.60.2.16 configure.m4 --- lib/configure.m4 17 Feb 2005 13:20:55 -0000 1.60.2.16 +++ lib/configure.m4 22 Mar 2005 15:18:10 -0000 @@ -470,8 +470,8 @@ EOF fi ;; esac done > chklayouts.tex + ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+' changequote([,])dnl - [eval] ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+' [eval] `cat chkconfig.vars | sed 's/-/_/g'` changequote(,)dnl test -n "${rmlink}" && rm -f chkconfig.ltx @@ -496,6 +496,24 @@ echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed sed -f chkconfig.sed "${srcdir}"/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx +### Let's check whether spaces are allowed in TeX file names +MSG_CHECKING(whether TeX allows spaces in file names) +if test ${lyx_check_config} = no ; then + tex_allows_spaces=false +else + fname="a b" + rm -f "$fname".tex + echo "\\message{working^^J}" >"$fname".tex + if ${LATEX} "$fname" </dev/null | grep 'working' >/dev/null ; then + MSG_RESULT(yes) + tex_allows_spaces=true + else + MSG_RESULT(no) + tex_allows_spaces=false + fi + rm -r "$fname".* +fi + echo "creating $outfile" cat >$outfile <<EOF # This file has been automatically generated by LyX' lib/configure @@ -565,6 +583,7 @@ cat >$outfile <<EOF $rc_entries \\font_encoding "$chk_fontenc" +\\tex_allows_spaces $tex_allows_spaces EOF if [ "x$use_cygwin_path_fix" != "x" ] Index: src/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v retrieving revision 1.1021.2.73 diff -u -p -r1.1021.2.73 ChangeLog --- src/ChangeLog 21 Mar 2005 11:12:22 -0000 1.1021.2.73 +++ src/ChangeLog 22 Mar 2005 15:18:10 -0000 @@ -1,3 +1,14 @@ +2005-03-10 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * lyxrc.C (setDefaults, read, output): add support for + tex_allows_spaces. + + * exporter.C (Export): allows files in directory containing spaces + if tex_allows_spaces is true. + + * buffer.C (makeLaTeXFile): if the document path contains spaces, + output it in double quotes. + 2005-03-21 Jürgen Spitzmüller <[EMAIL PROTECTED]> * lyx_main.C: fix binding of tabulator key (especially S-Tab). Index: src/buffer.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v retrieving revision 1.399.2.14 diff -u -p -r1.399.2.14 buffer.C --- src/buffer.C 28 Jan 2005 15:12:55 -0000 1.399.2.14 +++ src/buffer.C 22 Mar 2005 15:18:10 -0000 @@ -1744,6 +1744,8 @@ void Buffer::makeLaTeXFile(ostream & os, if (!original_path.empty()) { string inputpath = os::external_path(original_path); subst(inputpath, "~", "\\string~"); + if (inputpath.find(' ') != string::npos) + inputpath = '"' + inputpath + '"'; os << "\\makeatletter\n" << "[EMAIL PROTECTED]" << inputpath << "/}}\n" Index: src/exporter.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/exporter.C,v retrieving revision 1.25.2.3 diff -u -p -r1.25.2.3 exporter.C --- src/exporter.C 7 Dec 2004 10:48:22 -0000 1.25.2.3 +++ src/exporter.C 22 Mar 2005 15:18:10 -0000 @@ -83,7 +83,8 @@ bool Exporter::Export(Buffer * buffer, s // LaTeX backend else if (backend_format == format) buffer->makeLaTeXFile(filename, string(), true); - else if (contains(buffer->filePath(), ' ')) { + else if (!lyxrc.tex_allows_spaces + && contains(buffer->filePath(), ' ')) { Alert::alert(_("Cannot run LaTeX."), _("The path to the lyx file cannot contain spaces.")); return false; Index: src/lyxrc.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxrc.C,v retrieving revision 1.139.2.3 diff -u -p -r1.139.2.3 lyxrc.C --- src/lyxrc.C 1 Feb 2005 22:41:28 -0000 1.139.2.3 +++ src/lyxrc.C 22 Mar 2005 15:18:10 -0000 @@ -138,6 +138,7 @@ keyword_item lyxrcTags[] = { { "\\spell_command", LyXRC::RC_SPELL_COMMAND }, { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH }, { "\\template_path", LyXRC::RC_TEMPLATEPATH }, + { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES }, { "\\ui_file", LyXRC::RC_UIFILE }, { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG }, { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS }, @@ -250,6 +251,7 @@ void LyXRC::setDefaults() { default_language = "english"; show_banner = true; cygwin_path_fix = false; + tex_allows_spaces = false; date_insert_format = "%A, %e %B %Y"; cursor_follows_scrollbar = false; dialogs_iconify_with_main = false; @@ -387,6 +389,12 @@ int LyXRC::read(string const & filename) } break; + case RC_TEX_ALLOWS_SPACES: + if (lexrc.next()) { + tex_allows_spaces = lexrc.getBool(); + } + break; + case RC_KBMAP_PRIMARY: if (lexrc.next()) { string const kmap(lexrc.getString()); @@ -1257,6 +1265,11 @@ void LyXRC::output(ostream & os) const if (cygwin_path_fix != system_lyxrc.cygwin_path_fix) { os << "\\cygwin_path_fix_needed " << tostr(cygwin_path_fix) << '\n'; + } + case RC_TEX_ALLOWS_SPACES: + if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) { + os << "\\tex_allows_spaces " + << tostr(tex_allows_spaces) << '\n'; } case RC_KBMAP_PRIMARY: if (primary_kbmap != system_lyxrc.primary_kbmap) { Index: src/lyxrc.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxrc.h,v retrieving revision 1.69.2.2 diff -u -p -r1.69.2.2 lyxrc.h --- src/lyxrc.h 28 Jan 2005 15:12:56 -0000 1.69.2.2 +++ src/lyxrc.h 22 Mar 2005 15:18:10 -0000 @@ -124,6 +124,7 @@ enum LyXRCTags { RC_USE_PSPELL, #endif RC_CYGWIN_PATH_FIX, + RC_TEX_ALLOWS_SPACES, RC_PATH_PREFIX, RC_LAST }; @@ -357,6 +358,8 @@ enum LyXRCTags { float preview_scale_factor; /// bool cygwin_path_fix; + /// True if the TeX engine can handle file names containing spaces + bool tex_allows_spaces; /** Prepend paths to the PATH environment variable. * The string is input, stored and output in native format. */