Am Sonntag, den 08.01.2017, 09:22 -0500 schrieb Scott Kostyshak:
> > Ignoring the
> > missing glyphs warning strikes me a better alternative.
> 
> Perhaps. Does anyone volunteer to do this work?

Please try the attached patch. The lyx option 
--ignore-error-message missing_glyphs
does what you need.

--ignore-error-message can be expanded to other messages later, if this
 is desired.

And the option is sufficiently painful to write to prevent people using
it without thinking about what they are doing ;-)

Jürgen
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index c4f987014d..9faf20102e 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -18,6 +18,7 @@
 #include "BufferList.h"
 #include "LaTeX.h"
 #include "LyXRC.h"
+#include "LyX.h"
 #include "DepTable.h"
 
 #include "support/debug.h"
@@ -899,8 +900,9 @@ int LaTeX::scanLogFile(TeXErrors & terr)
 						 from_local8bit("pdfTeX Error"),
 						 from_local8bit(token),
 						 child_name);
-			} else if (prefixIs(token, "Missing character: There is no ")
-					   && !contains(token, "nullfont")) {
+			} else if (!ignore_missing_glyphs
+				   && prefixIs(token, "Missing character: There is no ")
+				   && !contains(token, "nullfont")) {
 				// Warning about missing glyph in selected font
 				// may be dataloss (bug 9610)
 				// but can be ignored for 'nullfont' (bug 10394).
diff --git a/src/LyX.cpp b/src/LyX.cpp
index b10b60b122..e10fbebcb1 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -98,6 +98,13 @@ bool use_gui = true;
 bool verbose = false;
 
 
+// Do not treat the "missing glyphs" warning of fontspec as an error message.
+// The default is false and can be changed with the option
+// --ignore-error-message missing_glyphs
+// This is used in automated testing.
+bool ignore_missing_glyphs = false;
+
+
 // We default to open documents in an already running instance, provided that
 // the lyxpipe has been setup. This can be overridden either on the command
 // line or through preference settings.
@@ -1309,6 +1316,16 @@ int parse_verbose(string const &, string const &, string &)
 }
 
 
+int parse_ignore_error_message(string const & arg1, string const &, string &)
+{
+	if (arg1 == "missing_glyphs") {
+		ignore_missing_glyphs = true;
+		return 1;
+	}
+	return 0;
+}
+
+
 int parse_force(string const & arg, string const &, string &)
 {
 	if (arg == "all") {
@@ -1358,6 +1375,7 @@ void LyX::easyParse(int & argc, char * argv[])
 	cmdmap["--remote"] = parse_remote;
 	cmdmap["-v"] = parse_verbose;
 	cmdmap["--verbose"] = parse_verbose;
+	cmdmap["--ignore-error-message"] = parse_ignore_error_message;
 
 	for (int i = 1; i < argc; ++i) {
 		map<string, cmd_helper>::const_iterator it
diff --git a/src/LyX.h b/src/LyX.h
index 4b9c201e25..11c67a3118 100644
--- a/src/LyX.h
+++ b/src/LyX.h
@@ -52,6 +52,7 @@ enum OverwriteFiles {
 
 extern bool use_gui;
 extern bool verbose;
+extern bool ignore_missing_glyphs;
 extern RunMode run_mode;
 extern OverwriteFiles force_overwrite;
 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to