On Wed, 2004-10-06 at 10:51, Angus Leeming wrote:
> Martin Vermeer wrote:
> >> Huh? The string stored in lyxrc::index_command is presumably something
> >> like
> >> "makeindex.sh -m $$lang". So, before you launch makeindex.sh in
> >> LaTeX.C's
> >> runMakeIndex, you need to substitute $$lang for the document language.
> >> 
> >> Where's the difficulty?
> > Where do I find the document language?
> 
> $ grep -n language bufferparams.h
> 111:    InsetQuotes::quote_language quotes_language;
> 164:    Language const * language;

Yes... what I was afraid of. Pulls in a lot... see attached patch. Does
this work for you too? And wasn't bufferlist something to get rid of
here? And is the use of first() kosher?

- 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