From: André Pönitz Date: Wed, 17 Jul 2002 14:57:37 +0000 (+0000) Subject: short cut for using converter scripts from lib/scripts X-Git-Tag: 1.6.10~18839 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6280787bdb6da8181afb704a9dad8921cd41ef5c;p=lyx.git short cut for using converter scripts from lib/scripts git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4681 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 452dfa8cf5..b952594f9f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ + +2002-07-15 André Pönitz + + * converter.C: add support for $$s (scripts from lib/scripts dir) + * lyx_main.C: white space + + 2002-07-17 John Levon * bufferlist.C: diff --git a/src/converter.C b/src/converter.C index b36c0c9a34..0e72ca8958 100644 --- a/src/converter.C +++ b/src/converter.C @@ -46,11 +46,14 @@ using std::find_if; using std::reverse; using std::sort; +extern string system_lyxdir; + namespace { string const token_from("$$i"); string const token_base("$$b"); string const token_to("$$o"); +string const token_lib("$$s"); ////////////////////////////////////////////////////////////////////////////// @@ -624,15 +627,15 @@ bool Converters::convert(Buffer const * buffer, runLaTeX(buffer, latex_command_); } - string infile2 = (conv.original_dir) + string const infile2 = (conv.original_dir) ? infile : MakeRelPath(infile, path); - string outfile2 = (conv.original_dir) + string const outfile2 = (conv.original_dir) ? outfile : MakeRelPath(outfile, path); - string command = conv.command; command = subst(command, token_from, QuoteName(infile2)); command = subst(command, token_base, QuoteName(from_base)); command = subst(command, token_to, QuoteName(outfile2)); + command = subst(command, token_lib, system_lyxdir + "scripts"); if (!conv.parselog.empty()) command += " 2> " + QuoteName(infile2 + ".out"); diff --git a/src/graphics/GraphicsConverter.C b/src/graphics/GraphicsConverter.C index 1182811e4d..31ac475372 100644 --- a/src/graphics/GraphicsConverter.C +++ b/src/graphics/GraphicsConverter.C @@ -28,6 +28,8 @@ #include #include // needed for pid_t +extern string system_lyxdir; + using std::endl; namespace grfx { @@ -272,6 +274,7 @@ bool build_script(string const & from_file, string const token_from("$$i"); string const token_base("$$b"); string const token_to("$$o"); + string const token_lib("$$s"); EdgePath::const_iterator it = edgepath.begin(); EdgePath::const_iterator end = edgepath.end(); @@ -292,6 +295,7 @@ bool build_script(string const & from_file, command = subst(command, token_from, "${infile}"); command = subst(command, token_base, "${infile_base}"); command = subst(command, token_to, "${outfile}"); + command = subst(command, token_lib, system_lyxdir + "scripts"); // Store in the shell script script << "\n" << command << "\n\n"; diff --git a/src/lyx_main.C b/src/lyx_main.C index 0e9e289c9e..0ac6fa81d7 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -240,7 +240,7 @@ void LyX::init(bool gui) // If we had a command line switch, system_lyxdir is already set string searchpath; if (!system_lyxdir.empty()) - searchpath= MakeAbsPath(system_lyxdir) + ';'; + searchpath = MakeAbsPath(system_lyxdir) + ';'; // LYX_DIR_13x environment variable string const lyxdir = GetEnvPath("LYX_DIR_13x");