* src/LaTeX.cpp (scanLogFile):

- parse file:line:error style messages (bug 4222)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@20336 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2007-09-18 13:39:18 +00:00
parent b4af3ad5a0
commit f535b7e321
2 changed files with 18 additions and 4 deletions

View File

@ -610,6 +610,8 @@ int LaTeX::scanLogFile(TeXErrors & terr)
LYXERR(Debug::LATEX) << "Log file: " << tmp << endl; LYXERR(Debug::LATEX) << "Log file: " << tmp << endl;
FileName const fn = FileName(makeAbsPath(tmp)); FileName const fn = FileName(makeAbsPath(tmp));
ifstream ifs(fn.toFilesystemEncoding().c_str()); ifstream ifs(fn.toFilesystemEncoding().c_str());
bool fle_style;
static regex file_line_error(".+\\.\\D+:[0-9]+: (.+)");
string token; string token;
while (getline(ifs, token)) { while (getline(ifs, token)) {
@ -619,12 +621,16 @@ int LaTeX::scanLogFile(TeXErrors & terr)
// \r's afterwards, since we need to remove them anyway. // \r's afterwards, since we need to remove them anyway.
token = subst(token, '\0', '\r'); token = subst(token, '\0', '\r');
token = subst(token, "\r", ""); token = subst(token, "\r", "");
smatch sub;
LYXERR(Debug::LATEX) << "Log line: " << token << endl; LYXERR(Debug::LATEX) << "Log line: " << token << endl;
if (token.empty()) if (token.empty())
continue; continue;
if (contains(token, "file:line:error style messages enabled"))
fle_style = true;
if (prefixIs(token, "LaTeX Warning:") || if (prefixIs(token, "LaTeX Warning:") ||
prefixIs(token, "! pdfTeX warning")) { prefixIs(token, "! pdfTeX warning")) {
// Here shall we handle different // Here shall we handle different
@ -668,12 +674,17 @@ int LaTeX::scanLogFile(TeXErrors & terr)
<< "We should rerun." << endl; << "We should rerun." << endl;
retval |= RERUN; retval |= RERUN;
} }
} else if (prefixIs(token, "! ")) { } else if (prefixIs(token, "! ") ||
// Ok, we have something that looks like a TeX Error fle_style && regex_match(token, sub, file_line_error)) {
// but what do we really have. // Ok, we have something that looks like a TeX Error
// but what do we really have.
// Just get the error description: // Just get the error description:
string desc(token, 2); string desc;
if (prefixIs(token, "! "))
desc = string(token, 2);
else if (fle_style)
desc = sub.str();
if (contains(token, "LaTeX Error:")) if (contains(token, "LaTeX Error:"))
retval |= LATEX_ERROR; retval |= LATEX_ERROR;
// get the next line // get the next line

View File

@ -83,6 +83,9 @@ What's new
- Handle array column specifiers @{decl.}, p{width} and the extensions by - Handle array column specifiers @{decl.}, p{width} and the extensions by
array.sty in mathed (bug 4132). array.sty in mathed (bug 4132).
- Detect (pdf)tex's file:line:error style messages that are used by some
distributions and that caused LyX to ignore LaTeX errors (bug 4222).
* USER INTERFACE: * USER INTERFACE:
- Fix crash when clicking in a tabular cell and the "delete empty paragraph" - Fix crash when clicking in a tabular cell and the "delete empty paragraph"