diff --git a/console/tidy.c b/console/tidy.c
index b01320f..86edb9a 100644
--- a/console/tidy.c
+++ b/console/tidy.c
@@ -1941,8 +1941,8 @@ int main( int argc, char** argv )
#if (!defined(NDEBUG) && defined(_MSC_VER))
SPRTF("Tidying '%s'\n", htmlfil);
#endif /* DEBUG outout */
- if ( tidyOptGetBool(tdoc, TidyEmacs) && !tidyOptGetValue(tdoc, TidyEmacsFile) )
- tidyOptSetValue( tdoc, TidyEmacsFile, htmlfil );
+ if ( tidyOptGetBool(tdoc, TidyEmacs) )
+ tidySetEmacsFile( tdoc, htmlfil );
status = tidyParseFile( tdoc, htmlfil );
}
else
diff --git a/include/tidy.h b/include/tidy.h
index b3fc61d..3cbff55 100644
--- a/include/tidy.h
+++ b/include/tidy.h
@@ -564,6 +564,22 @@ TIDY_EXPORT Bool TIDY_CALL tidyInitSink( TidyOutputSink* sink,
TIDY_EXPORT void TIDY_CALL tidyPutByte( TidyOutputSink* sink, uint byteValue );
+/****************
+ Emacs File
+****************/
+/** Set the file path to use for reports when `TidyEmacs` is being used. This
+** function provides a proper interface for using the hidden, internal-only
+** `TidyEmacsFile` configuration option.
+*/
+TIDY_EXPORT void TIDY_CALL tidySetEmacsFile( TidyDoc tdoc, ctmbstr filePath );
+
+/** Get the file path to use for reports when `TidyEmacs` is being used. This
+** function provides a proper interface for using the hidden, internal-only
+** `TidyEmacsFile` configuration option.
+*/
+TIDY_EXPORT ctmbstr TIDY_CALL tidyGetEmacsFile( TidyDoc tdoc );
+
+
/****************
Errors
****************/
diff --git a/localize/translations/language_en_gb.po b/localize/translations/language_en_gb.po
index cb9b288..34bf525 100644
--- a/localize/translations/language_en_gb.po
+++ b/localize/translations/language_en_gb.po
@@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
-"PO-Revision-Date: 2017-02-18 18:13:23\n"
+"PO-Revision-Date: 2017-03-07 20:09:19\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@@ -2773,21 +2773,6 @@ msgid ""
"errors and warnings to a format that is more easily parsed by GNU Emacs. "
msgstr ""
-#. Important notes for translators:
-#. - Use only
, , , , and
-#.
.
-#. - Entities, tags, attributes, etc., should be enclosed in
.
-#. - Option values should be enclosed in .
-#. - It's very important that
be self-closing!
-#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
-#. be translated.
-msgctxt "TidyEmacsFile"
-msgid ""
-"When gnu-emacs
is yes, then this option value "
-"specifies the filename to be used in the output report. The HTML Tidy "
-"command line program will set this automatically. "
-msgstr ""
-
#. Important notes for translators:
#. - Use only
, , , , and
#.
.
diff --git a/localize/translations/language_es.po b/localize/translations/language_es.po
index dad16a0..928aff7 100644
--- a/localize/translations/language_es.po
+++ b/localize/translations/language_es.po
@@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
-"PO-Revision-Date: 2017-02-18 18:13:23\n"
+"PO-Revision-Date: 2017-03-07 20:09:19\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@@ -2750,21 +2750,6 @@ msgid ""
"errors and warnings to a format that is more easily parsed by GNU Emacs. "
msgstr ""
-#. Important notes for translators:
-#. - Use only
, , , , and
-#.
.
-#. - Entities, tags, attributes, etc., should be enclosed in
.
-#. - Option values should be enclosed in .
-#. - It's very important that
be self-closing!
-#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
-#. be translated.
-msgctxt "TidyEmacsFile"
-msgid ""
-"When gnu-emacs
is yes, then this option value "
-"specifies the filename to be used in the output report. The HTML Tidy "
-"command line program will set this automatically. "
-msgstr ""
-
#. Important notes for translators:
#. - Use only
, , , , and
#.
.
diff --git a/localize/translations/language_es_mx.po b/localize/translations/language_es_mx.po
index d38eb37..b940c44 100644
--- a/localize/translations/language_es_mx.po
+++ b/localize/translations/language_es_mx.po
@@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
-"PO-Revision-Date: 2017-02-18 18:13:23\n"
+"PO-Revision-Date: 2017-03-07 20:09:19\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@@ -2745,21 +2745,6 @@ msgid ""
"errors and warnings to a format that is more easily parsed by GNU Emacs. "
msgstr ""
-#. Important notes for translators:
-#. - Use only
, , , , and
-#.
.
-#. - Entities, tags, attributes, etc., should be enclosed in
.
-#. - Option values should be enclosed in .
-#. - It's very important that
be self-closing!
-#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
-#. be translated.
-msgctxt "TidyEmacsFile"
-msgid ""
-"When gnu-emacs
is yes, then this option value "
-"specifies the filename to be used in the output report. The HTML Tidy "
-"command line program will set this automatically. "
-msgstr ""
-
#. Important notes for translators:
#. - Use only
, , , , and
#.
.
diff --git a/localize/translations/language_fr.po b/localize/translations/language_fr.po
index 5ec6b82..d53835e 100644
--- a/localize/translations/language_fr.po
+++ b/localize/translations/language_fr.po
@@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
-"PO-Revision-Date: 2017-02-18 18:13:23\n"
+"PO-Revision-Date: 2017-03-07 20:09:19\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@@ -2930,21 +2930,6 @@ msgid ""
"errors and warnings to a format that is more easily parsed by GNU Emacs. "
msgstr ""
-#. Important notes for translators:
-#. - Use only
, , , , and
-#.
.
-#. - Entities, tags, attributes, etc., should be enclosed in
.
-#. - Option values should be enclosed in .
-#. - It's very important that
be self-closing!
-#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
-#. be translated.
-msgctxt "TidyEmacsFile"
-msgid ""
-"When gnu-emacs
is yes, then this option value "
-"specifies the filename to be used in the output report. The HTML Tidy "
-"command line program will set this automatically. "
-msgstr ""
-
#. Important notes for translators:
#. - Use only
, , , , and
#.
.
diff --git a/localize/translations/language_zh_cn.po b/localize/translations/language_zh_cn.po
index 1738f87..dff98b4 100644
--- a/localize/translations/language_zh_cn.po
+++ b/localize/translations/language_zh_cn.po
@@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
-"PO-Revision-Date: 2017-02-18 18:13:23\n"
+"PO-Revision-Date: 2017-03-07 20:09:19\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@@ -2739,21 +2739,6 @@ msgid ""
"errors and warnings to a format that is more easily parsed by GNU Emacs. "
msgstr ""
-#. Important notes for translators:
-#. - Use only
, , , , and
-#.
.
-#. - Entities, tags, attributes, etc., should be enclosed in
.
-#. - Option values should be enclosed in .
-#. - It's very important that
be self-closing!
-#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
-#. be translated.
-msgctxt "TidyEmacsFile"
-msgid ""
-"When gnu-emacs
is yes, then this option value "
-"specifies the filename to be used in the output report. The HTML Tidy "
-"command line program will set this automatically. "
-msgstr ""
-
#. Important notes for translators:
#. - Use only
, , , , and
#.
.
diff --git a/localize/translations/tidy.pot b/localize/translations/tidy.pot
index 6e6c309..a68fe33 100644
--- a/localize/translations/tidy.pot
+++ b/localize/translations/tidy.pot
@@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
-"POT-Creation-Date: 2017-02-18 18:13:23\n"
+"POT-Creation-Date: 2017-03-07 20:09:19\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@@ -2741,21 +2741,6 @@ msgid ""
"errors and warnings to a format that is more easily parsed by GNU Emacs. "
msgstr ""
-#. Important notes for translators:
-#. - Use only
, , , , and
-#.
.
-#. - Entities, tags, attributes, etc., should be enclosed in
.
-#. - Option values should be enclosed in .
-#. - It's very important that
be self-closing!
-#. - The strings "Tidy" and "HTML Tidy" are the program name and must not
-#. be translated.
-msgctxt "TidyEmacsFile"
-msgid ""
-"When gnu-emacs
is yes, then this option value "
-"specifies the filename to be used in the output report. The HTML Tidy "
-"command line program will set this automatically. "
-msgstr ""
-
#. Important notes for translators:
#. - Use only
, , , , and
#.
.
diff --git a/src/config.c b/src/config.c
index e883420..0bdf0d9 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1589,6 +1589,9 @@ const TidyOptionImpl* TY_(getNextOption)( TidyDocImpl* ARG_UNUSED(doc),
{
option = &option_defs[ optId ];
optId++;
+ /* Hide these internal options from the API entirely. */
+ if ( optId == TidyEmacsFile || optId == TidyDoctypeMode )
+ optId++;
}
*iter = (TidyIterator) ( optId < N_TIDY_OPTIONS ? optId : (size_t)0 );
return option;
diff --git a/src/language_en.h b/src/language_en.h
index 8b88bb5..5bcd5d8 100644
--- a/src/language_en.h
+++ b/src/language_en.h
@@ -1847,19 +1847,6 @@ static languageDefinition language_en = { whichPluralForm_en, {
"This option specifies if Tidy should change the format for reporting "
"errors and warnings to a format that is more easily parsed by GNU Emacs. "
},
- {/* Important notes for translators:
- - Use only
, , , , and
-
.
- - Entities, tags, attributes, etc., should be enclosed in
.
- - Option values should be enclosed in .
- - It's very important that
be self-closing!
- - The strings "Tidy" and "HTML Tidy" are the program name and must not
- be translated. */
- TidyEmacsFile, 0,
- "When gnu-emacs
is yes, then this option value "
- "specifies the filename to be used in the output report. The HTML Tidy "
- "command line program will set this automatically. "
- },
{/* Important notes for translators:
- Use only
, , , , and
.
diff --git a/src/language_en_gb.h b/src/language_en_gb.h
index e5e7558..2ce9c92 100644
--- a/src/language_en_gb.h
+++ b/src/language_en_gb.h
@@ -28,7 +28,7 @@
*
* Orginating PO file metadata:
* PO_LAST_TRANSLATOR=jderry
- * PO_REVISION_DATE=2017-02-18 18:13:23
+ * PO_REVISION_DATE=2017-03-07 20:09:19
*/
#ifdef _MSC_VER
diff --git a/src/language_es.h b/src/language_es.h
index 11780b4..227e8fa 100644
--- a/src/language_es.h
+++ b/src/language_es.h
@@ -28,7 +28,7 @@
*
* Orginating PO file metadata:
* PO_LAST_TRANSLATOR=jderry
- * PO_REVISION_DATE=2017-02-18 18:13:23
+ * PO_REVISION_DATE=2017-03-07 20:09:19
*/
#ifdef _MSC_VER
diff --git a/src/language_es_mx.h b/src/language_es_mx.h
index 8a4daae..6ae653e 100644
--- a/src/language_es_mx.h
+++ b/src/language_es_mx.h
@@ -28,7 +28,7 @@
*
* Orginating PO file metadata:
* PO_LAST_TRANSLATOR=jderry
- * PO_REVISION_DATE=2017-02-18 18:13:23
+ * PO_REVISION_DATE=2017-03-07 20:09:19
*/
#ifdef _MSC_VER
diff --git a/src/language_fr.h b/src/language_fr.h
index d181f22..ed64416 100644
--- a/src/language_fr.h
+++ b/src/language_fr.h
@@ -28,7 +28,7 @@
*
* Orginating PO file metadata:
* PO_LAST_TRANSLATOR=jderry
- * PO_REVISION_DATE=2017-02-18 18:13:23
+ * PO_REVISION_DATE=2017-03-07 20:09:19
*/
#ifdef _MSC_VER
diff --git a/src/language_zh_cn.h b/src/language_zh_cn.h
index 2086732..7982bfe 100644
--- a/src/language_zh_cn.h
+++ b/src/language_zh_cn.h
@@ -28,7 +28,7 @@
*
* Orginating PO file metadata:
* PO_LAST_TRANSLATOR=jderry
- * PO_REVISION_DATE=2017-02-18 18:13:23
+ * PO_REVISION_DATE=2017-03-07 20:09:19
*/
#ifdef _MSC_VER
diff --git a/src/tidylib.c b/src/tidylib.c
index 531dc92..47002f3 100755
--- a/src/tidylib.c
+++ b/src/tidylib.c
@@ -649,6 +649,17 @@ Bool TIDY_CALL tidyOptCopyConfig( TidyDoc to, TidyDoc from )
** options will just be set directly.
*/
+void TIDY_CALL tidySetEmacsFile( TidyDoc tdoc, ctmbstr filePath )
+{
+ tidyOptSetValue( tdoc, TidyEmacsFile, filePath );
+}
+
+ctmbstr TIDY_CALL tidyGetEmacsFile( TidyDoc tdoc )
+{
+ return tidyOptGetValue( tdoc, TidyEmacsFile );
+}
+
+
/* Use TidyReportFilter to filter messages by diagnostic level:
** info, warning, etc. Just set diagnostic output
** handler to redirect all diagnostics output. Return true