On Wed, 2004-10-06 at 16:54, Jean-Marc Lasgouttes wrote:
> >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> Jean-Marc Lasgouttes wrote:
> >>>>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> >>
> Angus> Why not pass 'buffer' to LaTeX::run() ? That would enable you
> Angus> to proceed without jumping through hoops.
> >>  Or add the language to runparams.
> 
> Angus> Good idea. Incidentally, I don't understand the comment here:
> 
> Angus> struct OutputParams { /** the babel name of the language at the
> Angus> point where the inset is */ std::string lang; };
> 
> Angus> Won't the language change as one goes through the document?
> 
> Yes it does (and this is intended). This is used in InsetQuote::latex,
> for example.
> 
> JMarc

So I re-wrote the patch like attached... only problem is, runparams.lang
appears to be empty, no matter what I set as document language or even
"paint" the surroundings of the index inset to another language.

Sure this is supposed to work? Stumped.

- Martin

Index: src/LaTeX.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeX.C,v
retrieving revision 1.103
diff -u -r1.103 LaTeX.C
--- src/LaTeX.C	5 Oct 2004 10:11:26 -0000	1.103
+++ src/LaTeX.C	6 Oct 2004 11:45:50 -0000
@@ -15,6 +15,9 @@
 #include <config.h>
 
 #include "LaTeX.h"
+#include "buffer.h"
+#include "bufferparams.h"
+#include "language.h"
 #include "bufferlist.h"
 #include "gettext.h"
 #include "lyxrc.h"
@@ -44,6 +47,7 @@
 using lyx::support::QuoteName;
 using lyx::support::rtrim;
 using lyx::support::split;
+using lyx::support::subst;
 using lyx::support::suffixIs;
 using lyx::support::Systemcall;
 using lyx::support::unlink;
@@ -398,7 +402,10 @@
 	lyxerr[Debug::LATEX] << "idx file has been made,"
 		" running makeindex on file "
 			     <<  f << endl;
-	string tmp = lyxrc.index_command + " ";
+	string tmp = lyxrc.index_command + " ";
+	Buffer * buf = bufferlist.first();
+	string s = (*buf).params().language->babel();
+	tmp = subst(tmp, "$$lang", s);
 	tmp += QuoteName(f);
 	Systemcall one;
 	one.startscript(Systemcall::Wait, tmp);

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to