]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeX.C
LFUN_UNICODE_INSERT - unicode-insert
[lyx.git] / src / LaTeX.C
index 5c5a966eb4a19a452bde36066086b8889ba7b1bf..934b233ffbb69ae4817754ddb870b557f2154940 100644 (file)
 
 #include <config.h>
 
-#include "LaTeX.h"
 #include "bufferlist.h"
+#include "LaTeX.h"
 #include "gettext.h"
 #include "lyxrc.h"
 #include "debug.h"
 #include "DepTable.h"
+
 #include "support/filetools.h"
 #include "support/convert.h"
 #include "support/lstrings.h"
 
 #include <fstream>
 
-using lyx::support::absolutePath;
-using lyx::support::bformat;
-using lyx::support::changeExtension;
-using lyx::support::contains;
-using lyx::support::findtexfile;
-using lyx::support::getcwd;
-using lyx::support::onlyFilename;
-using lyx::support::prefixIs;
-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;
-using lyx::support::trim;
-
-namespace os = lyx::support::os;
+
+namespace lyx {
+
+using support::absolutePath;
+using support::bformat;
+using support::changeExtension;
+using support::contains;
+using support::findtexfile;
+using support::getcwd;
+using support::onlyFilename;
+using support::prefixIs;
+using support::quoteName;
+using support::rtrim;
+using support::split;
+using support::subst;
+using support::suffixIs;
+using support::Systemcall;
+using support::unlink;
+using support::trim;
+
+namespace os = support::os;
 namespace fs = boost::filesystem;
 
 using boost::regex;
@@ -68,7 +72,7 @@ using std::set;
 using std::vector;
 
 // TODO: in no particular order
-// - get rid of the extern BufferList and the call to
+// - get rid of the call to
 //   BufferList::updateIncludedTeXfiles, this should either
 //   be done before calling LaTeX::funcs or in a completely
 //   different way.
@@ -78,13 +82,11 @@ using std::vector;
 // - somewhere support viewing of bibtex and makeindex log files.
 // - we should perhaps also scan the bibtex log file
 
-extern BufferList bufferlist;
-
 namespace {
 
-string runMessage(unsigned int count)
+docstring runMessage(unsigned int count)
 {
-       return bformat(lyx::to_utf8(_("Waiting for LaTeX run number %1$d")), count);
+       return bformat(_("Waiting for LaTeX run number %1$d"), count);
 }
 
 } // anon namespace
@@ -177,7 +179,7 @@ int LaTeX::run(TeXErrors & terr)
        bool rerun = false; // rerun requested
 
        // The class LaTeX does not know the temp path.
-       bufferlist.updateIncludedTeXfiles(getcwd(), runparams);
+       theBufferList().updateIncludedTeXfiles(getcwd(), runparams);
 
        // Never write the depfile if an error was encountered.
 
@@ -278,7 +280,7 @@ int LaTeX::run(TeXErrors & terr)
        if (head.haschanged(onlyFilename(changeExtension(file, ".idx")))) {
                // no checks for now
                lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
-               message(lyx::to_utf8(_("Running MakeIndex.")));
+               message(_("Running MakeIndex."));
                rerun |= runMakeIndex(onlyFilename(changeExtension(file, ".idx")), runparams);
        }
 
@@ -290,7 +292,7 @@ int LaTeX::run(TeXErrors & terr)
                // tags is found -> run bibtex and set rerun = true;
                // no checks for now
                lyxerr[Debug::LATEX] << "Running BibTeX." << endl;
-               message(lyx::to_utf8(_("Running BibTeX.")));
+               message(_("Running BibTeX."));
                updateBibtexDependencies(head, bibtex_info);
                rerun |= runBibTeX(bibtex_info);
        } else if (!had_depfile) {
@@ -346,7 +348,7 @@ int LaTeX::run(TeXErrors & terr)
        if (head.haschanged(onlyFilename(changeExtension(file, ".idx")))) {
                // no checks for now
                lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
-               message(lyx::to_utf8(_("Running MakeIndex.")));
+               message(_("Running MakeIndex."));
                rerun = runMakeIndex(onlyFilename(changeExtension(file, ".idx")), runparams);
        }
 
@@ -397,8 +399,7 @@ int LaTeX::startscript()
 bool LaTeX::runMakeIndex(string const & f, OutputParams const & runparams)
 {
        lyxerr[Debug::LATEX] << "idx file has been made,"
-               " running makeindex on file "
-                            <<  f << endl;
+               " running makeindex on file " <<  f << endl;
        string tmp = lyxrc.index_command + " ";
        tmp = subst(tmp, "$$lang", runparams.document_language);
        tmp += quoteName(f);
@@ -815,3 +816,6 @@ void LaTeX::deplog(DepTable & head)
        // Make sure that the main .tex file is in the dependancy file.
        head.insert(onlyFilename(file), true);
 }
+
+
+} // namespace lyx