From: Juergen Spitzmueller Date: Mon, 2 Dec 2013 13:35:42 +0000 (+0100) Subject: Rerun makeindex if all nomencl entries have been removed (#8905) X-Git-Tag: 2.1.0rc1~374 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=027b5dc4af02675997bacc607622032918f62261;p=features.git Rerun makeindex if all nomencl entries have been removed (#8905) --- diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp index 22a3a97d46..294f09e273 100644 --- a/src/LaTeX.cpp +++ b/src/LaTeX.cpp @@ -268,7 +268,12 @@ int LaTeX::run(TeXErrors & terr) runparams); } FileName const nlofile(changeExtension(file.absFileName(), ".nlo")); - if (head.haschanged(nlofile)) + // If all nomencl entries are removed, nomencl writes an empty nlo file. + // DepTable::hasChanged() returns false in this case, since it does not + // distinguish empty files from non-existing files. This is why we need + // the extra checks here (to trigger a rerun). Cf. discussions in #8905. + // FIXME: Sort out the real problem in DepTable. + if (head.haschanged(nlofile) || (nlofile.exists() && nlofile.isFileEmpty())) rerun |= runMakeIndexNomencl(file, ".nlo", ".nls"); FileName const glofile(changeExtension(file.absFileName(), ".glo")); if (head.haschanged(glofile))