mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
a couple of small fixes + a fix for the error in bibtex files problem
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@706 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
42a571c8c1
commit
e6d063c431
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
2000-04-28 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||||
|
|
||||||
|
* src/lyx_main.C (easyParse): use lyxerr instead of cerr.
|
||||||
|
|
||||||
|
* src/lyx_cb.C: add using std::reverse;
|
||||||
|
|
||||||
|
* src/LaTeX.C (run): on error always run deleteFilesOnError before
|
||||||
|
returning.
|
||||||
|
|
||||||
|
* src/LaTeX.[Ch] (deleteFilesOnError): new method. unlinks some
|
||||||
|
selected files. Should fix repeated errors from generated files.
|
||||||
|
|
||||||
2000-04-27 Dekel Tsur <dekel@math.tau.ac.il>
|
2000-04-27 Dekel Tsur <dekel@math.tau.ac.il>
|
||||||
|
|
||||||
* src/lyx_cb.C (TocUpdateCB): Reverse strings for Hebrew paragraphs
|
* src/lyx_cb.C (TocUpdateCB): Reverse strings for Hebrew paragraphs
|
||||||
|
50
src/LaTeX.C
50
src/LaTeX.C
@ -98,6 +98,31 @@ LaTeX::LaTeX(string const & latex, string const & f, string const & p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LaTeX::deleteFilesOnError() const
|
||||||
|
{
|
||||||
|
// currently just a dummy function.
|
||||||
|
|
||||||
|
// What files do we have to delete?
|
||||||
|
|
||||||
|
// This will at least make latex do all the runs
|
||||||
|
::unlink(depfile.c_str());
|
||||||
|
|
||||||
|
// but the reason for the error might be in a generated file...
|
||||||
|
|
||||||
|
// bibtex file
|
||||||
|
string bbl = ChangeExtension(file, ".bbl", true);
|
||||||
|
::unlink(bbl.c_str());
|
||||||
|
|
||||||
|
// makeindex file
|
||||||
|
string ind = ChangeExtension(file, ".ind", true);
|
||||||
|
::unlink(ind.c_str());
|
||||||
|
|
||||||
|
// Also remove the aux file
|
||||||
|
string aux = ChangeExtension(file, ".aux", true);
|
||||||
|
::unlink(aux.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
||||||
// We know that this function will only be run if the lyx buffer
|
// We know that this function will only be run if the lyx buffer
|
||||||
// has been changed. We also know that a newly written .tex file
|
// has been changed. We also know that a newly written .tex file
|
||||||
@ -151,7 +176,11 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
|||||||
minib->Store();
|
minib->Store();
|
||||||
this->operator()();
|
this->operator()();
|
||||||
scanres = scanLogFile(terr);
|
scanres = scanLogFile(terr);
|
||||||
if (scanres & LaTeX::ERRORS) return scanres; // return on error
|
if (scanres & LaTeX::ERRORS) {
|
||||||
|
deleteFilesOnError();
|
||||||
|
return scanres; // return on error
|
||||||
|
}
|
||||||
|
|
||||||
run_bibtex = scanAux(head);
|
run_bibtex = scanAux(head);
|
||||||
if (run_bibtex)
|
if (run_bibtex)
|
||||||
lyxerr[Debug::DEPEND]
|
lyxerr[Debug::DEPEND]
|
||||||
@ -164,6 +193,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
|||||||
++count;
|
++count;
|
||||||
lyxerr[Debug::DEPEND]
|
lyxerr[Debug::DEPEND]
|
||||||
<< "Dependency file does not exist" << endl;
|
<< "Dependency file does not exist" << endl;
|
||||||
|
|
||||||
lyxerr[Debug::LATEX]
|
lyxerr[Debug::LATEX]
|
||||||
<< "Run #" << count << endl;
|
<< "Run #" << count << endl;
|
||||||
head.insert(file, true);
|
head.insert(file, true);
|
||||||
@ -171,7 +201,11 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
|||||||
minib->Store();
|
minib->Store();
|
||||||
this->operator()();
|
this->operator()();
|
||||||
scanres = scanLogFile(terr);
|
scanres = scanLogFile(terr);
|
||||||
if (scanres & LaTeX::ERRORS) return scanres; // return on error
|
if (scanres & LaTeX::ERRORS) {
|
||||||
|
deleteFilesOnError();
|
||||||
|
return scanres; // return on error
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the dependencies.
|
// update the dependencies.
|
||||||
@ -232,7 +266,11 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
|||||||
minib->Store();
|
minib->Store();
|
||||||
this->operator()();
|
this->operator()();
|
||||||
scanres = scanLogFile(terr);
|
scanres = scanLogFile(terr);
|
||||||
if (scanres & LaTeX::ERRORS) return scanres; // return on error
|
if (scanres & LaTeX::ERRORS) {
|
||||||
|
deleteFilesOnError();
|
||||||
|
return scanres; // return on error
|
||||||
|
}
|
||||||
|
|
||||||
// update the depedencies
|
// update the depedencies
|
||||||
deplog(head); // reads the latex log
|
deplog(head); // reads the latex log
|
||||||
head.update();
|
head.update();
|
||||||
@ -278,7 +316,11 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
|
|||||||
minib->Store();
|
minib->Store();
|
||||||
this->operator()();
|
this->operator()();
|
||||||
scanres = scanLogFile(terr);
|
scanres = scanLogFile(terr);
|
||||||
if (scanres & LaTeX::ERRORS) return scanres; // return on error
|
if (scanres & LaTeX::ERRORS) {
|
||||||
|
deleteFilesOnError();
|
||||||
|
return scanres; // return on error
|
||||||
|
}
|
||||||
|
|
||||||
// keep this updated
|
// keep this updated
|
||||||
head.update();
|
head.update();
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,9 @@ protected:
|
|||||||
|
|
||||||
///
|
///
|
||||||
bool runBibTeX(string const &, DepTable &);
|
bool runBibTeX(string const &, DepTable &);
|
||||||
|
|
||||||
|
///
|
||||||
|
void deleteFilesOnError() const;
|
||||||
|
|
||||||
///
|
///
|
||||||
string cmd;
|
string cmd;
|
||||||
|
@ -55,6 +55,7 @@ using std::cout;
|
|||||||
using std::ios;
|
using std::ios;
|
||||||
using std::istream_iterator;
|
using std::istream_iterator;
|
||||||
using std::pair;
|
using std::pair;
|
||||||
|
using std::reverse;
|
||||||
|
|
||||||
extern Combox * combo_language;
|
extern Combox * combo_language;
|
||||||
extern Combox * combo_language2;
|
extern Combox * combo_language2;
|
||||||
@ -3239,7 +3240,8 @@ extern "C" void TocUpdateCB(FL_OBJECT *, long)
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
if (par->isRightToLeftPar())
|
if (par->isRightToLeftPar())
|
||||||
reverse(line+pos0,line+pos);
|
reverse(line + pos0, line + pos);
|
||||||
|
|
||||||
line[pos] = '\0';
|
line[pos] = '\0';
|
||||||
fl_add_browser_line(fd_form_toc->browser_toc, line);
|
fl_add_browser_line(fd_form_toc->browser_toc, line);
|
||||||
|
|
||||||
|
@ -602,7 +602,8 @@ bool LyX::easyParse(int * argc, char * argv[])
|
|||||||
--i; // After shift, check this number again.
|
--i; // After shift, check this number again.
|
||||||
|
|
||||||
batch_command = "buffer-import " + type + " " + file;
|
batch_command = "buffer-import " + type + " " + file;
|
||||||
cerr << "batch_command: " << batch_command << endl;
|
lyxerr << "batch_command: "
|
||||||
|
<< batch_command << endl;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
lyxerr << _("Missing type [eg latex, "
|
lyxerr << _("Missing type [eg latex, "
|
||||||
|
Loading…
Reference in New Issue
Block a user