Repository: biojppm/rapidyaml (language: python)

Issue:
Using in conjunction with Qt
If I #include a Qt header (specifically, the one I tried was `<QFileDialog>`) before including ryml.hpp, I get a compilation error:

(test.cpp - an otherwise empty file):

```
#include <QFileDialog>
#include <ryml.hpp>
```
gives me on Linux (Qt 5.15.2 with gcc 8.1):

```
In file included from rapidyaml/src/./c4/yml/yml.hpp:6,
                 from rapidyaml/src/ryml.hpp:4,
                 from _TestPropertiesWidget.cpp:19:
rapidyaml/src/./c4/yml/./emit.hpp:63:27: error: expected ‘)’ before ‘type’
     substr emit(EmitType_e type, Tree const& t, size_t id, bool error_on_excess);
                ~          ^~~~~
                           )
rapidyaml/src/./c4/yml/./emit.hpp:65:27: error: expected ‘)’ before ‘type’
     substr emit(EmitType_e type, Tree const& t, bool error_on_excess=true) { return emit(type, t, t.root_id(), error_on_excess); }
                ~          ^~~~~
                           )
In file included from rapidyaml/src/./c4/yml/yml.hpp:6,
                 from rapidyaml/src/ryml.hpp:4,
                 from _TestPropertiesWidget.cpp:19:
rapidyaml/src/./c4/yml/./emit.hpp:67:27: error: expected ‘)’ before ‘type’
     substr emit(EmitType_e type, NodeRef const& n, bool error_on_excess=true) { return emit(type, *n.tree(), n.id(), error_on_excess); }
                ~          ^~~~~
                           )
rapidyaml/src/./c4/yml/./emit.hpp:109:24: error: expected ‘)’ before ‘const’
 inline size_t emit(Tree const& t, size_t id, FILE *f)
                   ~    ^~~~~~
                        )
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘size_t c4::yml::emit_json(const c4::yml::Tree&, size_t, FILE*)’:
rapidyaml/src/./c4/yml/./emit.hpp:120:25: error: expected unqualified-id before ‘(’ token
     size_t len = em.emit(JSON, t, id, /*error_on_excess*/true).len;
                         ^
rapidyaml/src/./c4/yml/./emit.hpp: At global scope:
rapidyaml/src/./c4/yml/./emit.hpp:127:24: error: expected ‘)’ before ‘const’
 inline size_t emit(Tree const& t, FILE *f=nullptr)
                   ~    ^~~~~~
                        )
rapidyaml/src/./c4/yml/./emit.hpp:142:27: error: expected ‘)’ before ‘const’
 inline size_t emit(NodeRef const& r, FILE *f=nullptr)
                   ~       ^~~~~~
                           )
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘OStream& c4::yml::operator<<(OStream&, const c4::yml::Tree&)’:
rapidyaml/src/./c4/yml/./emit.hpp:162:12: error: expected unqualified-id before ‘(’ token
     em.emit(YAML, t.rootref());
            ^
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘OStream& c4::yml::operator<<(OStream&, const c4::yml::NodeRef&)’:
rapidyaml/src/./c4/yml/./emit.hpp:172:12: error: expected unqualified-id before ‘(’ token
     em.emit(YAML, n);
            ^
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘OStream& c4::yml::operator<<(OStream&, const c4::yml::as_json&)’:
rapidyaml/src/./c4/yml/./emit.hpp:181:12: error: expected unqualified-id before ‘(’ token
     em.emit(JSON, *js.tree, js.node);
            ^
rapidyaml/src/./c4/yml/./emit.hpp: At global scope:
rapidyaml/src/./c4/yml/./emit.hpp:191:24: error: expected ‘)’ before ‘const’
 inline substr emit(Tree const& t, size_t id, substr buf, bool error_on_excess=true)
                   ~    ^~~~~~
                        )
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘c4::substr c4::yml::emit_json(const c4::yml::Tree&, size_t, c4::substr, bool)’:
rapidyaml/src/./c4/yml/./emit.hpp:203:28: error: expected unqualified-id before ‘(’ token
     substr result = em.emit(JSON, t, id, error_on_excess);
                            ^
rapidyaml/src/./c4/yml/./emit.hpp: At global scope:
rapidyaml/src/./c4/yml/./emit.hpp:210:24: error: expected ‘)’ before ‘const’
 inline substr emit(Tree const& t, substr buf, bool error_on_excess=true)
                   ~    ^~~~~~
                        )
rapidyaml/src/./c4/yml/./emit.hpp:226:27: error: expected ‘)’ before ‘const’
 inline substr emit(NodeRef const& r, substr buf, bool error_on_excess=true)
                   ~       ^~~~~~
                           )
In file included from rapidyaml/src/./c4/yml/./emit.hpp:363,
                 from rapidyaml/src/./c4/yml/yml.hpp:6,
                 from rapidyaml/src/ryml.hpp:4,
                 from _TestPropertiesWidget.cpp:19:
rapidyaml/src/./c4/yml/././emit.def.hpp:13:29: error: expected unqualified-id before ‘(’ token
 substr Emitter<Writer>::emit(EmitType_e type, Tree const& t, size_t id, bool error_on_excess)
                             ^
```
and on Windows (with the same version of Qt and VS2019):

```
emit.hpp(63,28): error C2146: syntax error: missing ')' before identifier 'type'
emit.hpp(100): message : see reference to class template instantiation 'c4::yml::Emitter<Writer>' being compiled
emit.hpp(63,1): error C3646: 'type': unknown override specifier
emit.hpp(63,39): error C2143: syntax error: missing ';' before 'const'
emit.hpp(63,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
emit.hpp(63,1): error C3646: 'id': unknown override specifier
emit.hpp(63,60): error C2062: type 'bool' unexpected
emit.hpp(65,28): error C2146: syntax error: missing ')' before identifier 'type'
emit.hpp(65,1): error C3646: 'type': unknown override specifier
emit.hpp(65,17): error C2086: 'c4::substr c4::yml::Emitter<Writer>::EmitType_e': redefinition
emit.hpp(63): message : see declaration of 'c4::yml::Emitter<Writer>::EmitType_e'
emit.hpp(65,39): error C2143: syntax error: missing ';' before 'const'
emit.hpp(65,34): error C2086: 'c4::substr c4::yml::Emitter<Writer>::Tree': redefinition
emit.hpp(63): message : see declaration of 'c4::yml::Emitter<Writer>::Tree'
emit.hpp(65,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
emit.hpp(65,46): error C2086: 'const int &c4::yml::Emitter<Writer>::t': redefinition
emit.hpp(63): message : see declaration of 'c4::yml::Emitter<Writer>::t'
```
...and many more in a similar vein. If I simply swap around the order of the two includes, putting ryml.hpp first, then everything works fine, on both platforms.
Using in conjunction with Qt
If I #include a Qt header (specifically, the one I tried was `<QFileDialog>`) before including ryml.hpp, I get a compilation error:

(test.cpp - an otherwise empty file):

```
#include <QFileDialog>
#include <ryml.hpp>
```
gives me on Linux (Qt 5.15.2 with gcc 8.1):

```
In file included from rapidyaml/src/./c4/yml/yml.hpp:6,
                 from rapidyaml/src/ryml.hpp:4,
                 from _TestPropertiesWidget.cpp:19:
rapidyaml/src/./c4/yml/./emit.hpp:63:27: error: expected ‘)’ before ‘type’
     substr emit(EmitType_e type, Tree const& t, size_t id, bool error_on_excess);
                ~          ^~~~~
                           )
rapidyaml/src/./c4/yml/./emit.hpp:65:27: error: expected ‘)’ before ‘type’
     substr emit(EmitType_e type, Tree const& t, bool error_on_excess=true) { return emit(type, t, t.root_id(), error_on_excess); }
                ~          ^~~~~
                           )
In file included from rapidyaml/src/./c4/yml/yml.hpp:6,
                 from rapidyaml/src/ryml.hpp:4,
                 from _TestPropertiesWidget.cpp:19:
rapidyaml/src/./c4/yml/./emit.hpp:67:27: error: expected ‘)’ before ‘type’
     substr emit(EmitType_e type, NodeRef const& n, bool error_on_excess=true) { return emit(type, *n.tree(), n.id(), error_on_excess); }
                ~          ^~~~~
                           )
rapidyaml/src/./c4/yml/./emit.hpp:109:24: error: expected ‘)’ before ‘const’
 inline size_t emit(Tree const& t, size_t id, FILE *f)
                   ~    ^~~~~~
                        )
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘size_t c4::yml::emit_json(const c4::yml::Tree&, size_t, FILE*)’:
rapidyaml/src/./c4/yml/./emit.hpp:120:25: error: expected unqualified-id before ‘(’ token
     size_t len = em.emit(JSON, t, id, /*error_on_excess*/true).len;
                         ^
rapidyaml/src/./c4/yml/./emit.hpp: At global scope:
rapidyaml/src/./c4/yml/./emit.hpp:127:24: error: expected ‘)’ before ‘const’
 inline size_t emit(Tree const& t, FILE *f=nullptr)
                   ~    ^~~~~~
                        )
rapidyaml/src/./c4/yml/./emit.hpp:142:27: error: expected ‘)’ before ‘const’
 inline size_t emit(NodeRef const& r, FILE *f=nullptr)
                   ~       ^~~~~~
                           )
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘OStream& c4::yml::operator<<(OStream&, const c4::yml::Tree&)’:
rapidyaml/src/./c4/yml/./emit.hpp:162:12: error: expected unqualified-id before ‘(’ token
     em.emit(YAML, t.rootref());
            ^
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘OStream& c4::yml::operator<<(OStream&, const c4::yml::NodeRef&)’:
rapidyaml/src/./c4/yml/./emit.hpp:172:12: error: expected unqualified-id before ‘(’ token
     em.emit(YAML, n);
            ^
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘OStream& c4::yml::operator<<(OStream&, const c4::yml::as_json&)’:
rapidyaml/src/./c4/yml/./emit.hpp:181:12: error: expected unqualified-id before ‘(’ token
     em.emit(JSON, *js.tree, js.node);
            ^
rapidyaml/src/./c4/yml/./emit.hpp: At global scope:
rapidyaml/src/./c4/yml/./emit.hpp:191:24: error: expected ‘)’ before ‘const’
 inline substr emit(Tree const& t, size_t id, substr buf, bool error_on_excess=true)
                   ~    ^~~~~~
                        )
rapidyaml/src/./c4/yml/./emit.hpp: In function ‘c4::substr c4::yml::emit_json(const c4::yml::Tree&, size_t, c4::substr, bool)’:
rapidyaml/src/./c4/yml/./emit.hpp:203:28: error: expected unqualified-id before ‘(’ token
     substr result = em.emit(JSON, t, id, error_on_excess);
                            ^
rapidyaml/src/./c4/yml/./emit.hpp: At global scope:
rapidyaml/src/./c4/yml/./emit.hpp:210:24: error: expected ‘)’ before ‘const’
 inline substr emit(Tree const& t, substr buf, bool error_on_excess=true)
                   ~    ^~~~~~
                        )
rapidyaml/src/./c4/yml/./emit.hpp:226:27: error: expected ‘)’ before ‘const’
 inline substr emit(NodeRef const& r, substr buf, bool error_on_excess=true)
                   ~       ^~~~~~
                           )
In file included from rapidyaml/src/./c4/yml/./emit.hpp:363,
                 from rapidyaml/src/./c4/yml/yml.hpp:6,
                 from rapidyaml/src/ryml.hpp:4,
                 from _TestPropertiesWidget.cpp:19:
rapidyaml/src/./c4/yml/././emit.def.hpp:13:29: error: expected unqualified-id before ‘(’ token
 substr Emitter<Writer>::emit(EmitType_e type, Tree const& t, size_t id, bool error_on_excess)
                             ^
```
and on Windows (with the same version of Qt and VS2019):

```
emit.hpp(63,28): error C2146: syntax error: missing ')' before identifier 'type'
emit.hpp(100): message : see reference to class template instantiation 'c4::yml::Emitter<Writer>' being compiled
emit.hpp(63,1): error C3646: 'type': unknown override specifier
emit.hpp(63,39): error C2143: syntax error: missing ';' before 'const'
emit.hpp(63,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
emit.hpp(63,1): error C3646: 'id': unknown override specifier
emit.hpp(63,60): error C2062: type 'bool' unexpected
emit.hpp(65,28): error C2146: syntax error: missing ')' before identifier 'type'
emit.hpp(65,1): error C3646: 'type': unknown override specifier
emit.hpp(65,17): error C2086: 'c4::substr c4::yml::Emitter<Writer>::EmitType_e': redefinition
emit.hpp(63): message : see declaration of 'c4::yml::Emitter<Writer>::EmitType_e'
emit.hpp(65,39): error C2143: syntax error: missing ';' before 'const'
emit.hpp(65,34): error C2086: 'c4::substr c4::yml::Emitter<Writer>::Tree': redefinition
emit.hpp(63): message : see declaration of 'c4::yml::Emitter<Writer>::Tree'
emit.hpp(65,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
emit.hpp(65,46): error C2086: 'const int &c4::yml::Emitter<Writer>::t': redefinition
emit.hpp(63): message : see declaration of 'c4::yml::Emitter<Writer>::t'
```
...and many more in a similar vein. If I simply swap around the order of the two includes, putting ryml.hpp first, then everything works fine, on both platforms.


Discussion / hints:
@EosPengwern thanks for reporting, and sorry for the very late reply. 

The `QFileDialog` header is leaking a define with the very common name `emit`. This then causes a parse error in the ryml methods named `emit()`.

You can verify the above by doing this:
```c++
#include <QFileDialog>
#ifdef emit
#error "qt is leaking emit"
#endif
```

Or you can do a workaround like this:
```c++
#include <QFileDialog>
#undef emit
#include <ryml.hpp>
```

HTH! I'm closing as the problem comes from Qt and not ryml.

I think it is a problem of ryml that the library is incompatible with a very popular C++ framework. The bigger library wins, and their define is older :)
Thanks for reopening the issue and considering my request to look into it. At the very least, may I suggest including this caveat and the solution (#undef) into README?
You made a sound argument. I plan on adding a `#pragma` compile-time warning to ryml to let the user know about this. I don't see anything else that can be done to reliably work around the naming conflict.
That is a great idea, it didn't occur to me! The only other solution is to rename `emit` to something else.
I've found a workaround for this problem. I've written:

`#undef emit

#include "rapidyaml-0.4.1.hpp"

#define emit`

And the software I'm working on compiles fine with Qt. But I had to limit usage of rapidyaml to a single class so that the problem doesn't emerge anywhere else. This solution wont'be convenient for a software with a wider rapidyaml usage, so method renaming would be very welcome.
@kdidkovsky if you put all of that into a header (wrapping the include), the limit goes away. Eg, like this:
```c++
// myrapidyaml.h
#pragma once // or a plain old #ifdef include guard
#undef emit
#include "rapidyaml-0.4.1.hpp"
```
Then just use your header *everywhere*:
```c++
// file1.cpp
#include "myrapidyaml.h"

// file2.cpp
#include "myrapidyaml.h"
```
... and you can do this without any limits on usage. That's easy, no?

To be clear, I will not rename the `emit()` method. But the `#pragma` warning and the note in the README are due, and that is why this issue is still open.
That's workable, but annoying to have to do. I would, of course, not rename the `emit` method - it's needed for compatibility, but I would add an alternative name for it. E. g. define a new method `build` or `create` or `write` - whatever fits semantically, give this method the implementation of `emit`, and make `emit` a wrapper for the new method. That way people who use Qt can call the new alternative method and not encounter the hassle, and the existing code base can keep using `emit`.
@EosPengwern thanks for reporting, and sorry for the very late reply. 

The `QFileDialog` header is leaking a define with the very common name `emit`. This then causes a parse error in the ryml methods named `emit()`.

You can verify the above by doing this:
```c++
#include <QFileDialog>
#ifdef emit
#error "qt is leaking emit"
#endif
```

Or you can do a workaround like this:
```c++
#include <QFileDialog>
#undef emit
#include <ryml.hpp>
```

HTH! I'm closing as the problem comes from Qt and not ryml.

I think it is a problem of ryml that the library is incompatible with a very popular C++ framework. The bigger library wins, and their define is older :)
Thanks for reopening the issue and considering my request to look into it. At the very least, may I suggest including this caveat and the solution (#undef) into README?
You made a sound argument. I plan on adding a `#pragma` compile-time warning to ryml to let the user know about this. I don't see anything else that can be done to reliably work around the naming conflict.
That is a great idea, it didn't occur to me! The only other solution is to rename `emit` to something else.
I've found a workaround for this problem. I've written:

`#undef emit

#include "rapidyaml-0.4.1.hpp"

#define emit`

And the software I'm working on compiles fine with Qt. But I had to limit usage of rapidyaml to a single class so that the problem doesn't emerge anywhere else. This solution wont'be convenient for a software with a wider rapidyaml usage, so method renaming would be very welcome.
@kdidkovsky if you put all of that into a header (wrapping the include), the limit goes away. Eg, like this:
```c++
// myrapidyaml.h
#pragma once // or a plain old #ifdef include guard
#undef emit
#include "rapidyaml-0.4.1.hpp"
```
Then just use your header *everywhere*:
```c++
// file1.cpp
#include "myrapidyaml.h"

// file2.cpp
#include "myrapidyaml.h"
```
... and you can do this without any limits on usage. That's easy, no?

To be clear, I will not rename the `emit()` method. But the `#pragma` warning and the note in the README are due, and that is why this issue is still open.
That's workable, but annoying to have to do. I would, of course, not rename the `emit` method - it's needed for compatibility, but I would add an alternative name for it. E. g. define a new method `build` or `create` or `write` - whatever fits semantically, give this method the implementation of `emit`, and make `emit` a wrapper for the new method. That way people who use Qt can call the new alternative method and not encounter the hassle, and the existing code base can keep using `emit`.

Fix patch:
diff --git a/README.md b/README.md
index 0ce08b3e8..e3d275279 100644
--- a/README.md
+++ b/README.md
@@ -587,16 +587,16 @@ CHECK(!constsomething.valid());
 // Emitting:
 
 // emit to a FILE*
-ryml::emit(tree, stdout);
+ryml::emit_yaml(tree, stdout); // there is also emit_json()
 // emit to a stream
 std::stringstream ss;
 ss << tree;
 std::string stream_result = ss.str();
 // emit to a buffer:
-std::string str_result = ryml::emitrs<std::string>(tree);
+std::string str_result = ryml::emitrs_yaml<std::string>(tree); // there is also emitrs_json()
 // can emit to any given buffer:
 char buf[1024];
-ryml::csubstr buf_result = ryml::emit(tree, buf);
+ryml::csubstr buf_result = ryml::emit_yaml(tree, buf);
 // now check
 ryml::csubstr expected_result = R"(foo: says who
 bar:
diff --git a/changelog/0.5.0.md b/changelog/0.5.0.md
index 84f50a528..34184ee87 100644
--- a/changelog/0.5.0.md
+++ b/changelog/0.5.0.md
@@ -28,6 +28,7 @@
   ```
 - The initial version of `ConstNodeRef/NodeRef` had the problem that const methods in the CRTP base did not participate in overload resolution ([#294](https://github.com/biojppm/rapidyaml/issues/294)), preventing calls from `const NodeRef` objects. This was fixed by moving non-const methods to the CRTP base and disabling them with SFINAE ([PR#295](https://github.com/biojppm/rapidyaml/pull/295)).
 - Also added disambiguation iteration methods: `.cbegin()`, `.cend()`, `.cchildren()`, `.csiblings()` ([PR#295](https://github.com/biojppm/rapidyaml/pull/295)).
+- Deprecate `emit()` and `emitrs()` ([#120](https://github.com/biojppm/rapidyaml/issues/120), [PR#303](https://github.com/biojppm/rapidyaml/pull/303)): use `emit_yaml()` and `emitrs_yaml()` instead. This was done to improve compatibility with Qt, which leaks a macro named `emit`. For more information, see . 
 
 
 ### Performance improvements
diff --git a/samples/quickstart.cpp b/samples/quickstart.cpp
index 8b5f1f05f..b36e534ca 100644
--- a/samples/quickstart.cpp
+++ b/samples/quickstart.cpp
@@ -496,16 +496,16 @@ void sample_quick_overview()
     // Emitting:
 
     // emit to a FILE*
-    ryml::emit(tree, stdout);
+    ryml::emit_yaml(tree, stdout);
     // emit to a stream
     std::stringstream ss;
     ss << tree;
     std::string stream_result = ss.str();
     // emit to a buffer:
-    std::string str_result = ryml::emitrs<std::string>(tree);
+    std::string str_result = ryml::emitrs_yaml<std::string>(tree);
     // can emit to any given buffer:
     char buf[1024];
-    ryml::csubstr buf_result = ryml::emit(tree, buf);
+    ryml::csubstr buf_result = ryml::emit_yaml(tree, buf);
     // now check
     ryml::csubstr expected_result = R"(foo: says who
 bar:
@@ -1523,7 +1523,7 @@ void sample_parse_reuse_tree()
     CHECK(root["bar"].key() == "bar");
     CHECK(root["bar"][0].val() == "2");
     CHECK(root["bar"][1].val() == "3");
-    CHECK(ryml::emitrs<std::string>(tree) == R"(foo: 1
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(foo: 1
 bar:
   - 2
   - 3
@@ -1531,7 +1531,7 @@ void sample_parse_reuse_tree()
 
     // WATCHOUT: parsing into an existing tree will APPEND to it:
     ryml::parse_in_arena("{foo2: 12, bar2: [22, 32]}", &tree);
-    CHECK(ryml::emitrs<std::string>(tree) == R"(foo: 1
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(foo: 1
 bar:
   - 2
   - 3
@@ -1554,7 +1554,7 @@ foo2: 12
     tree.clear();
     tree.clear_arena();  // you may or may not want to clear the arena
     ryml::parse_in_arena("[a, b, {x0: 1, x1: 2}]", &tree);
-    CHECK(ryml::emitrs<std::string>(tree) == R"(- a
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(- a
 - b
 - x0: 1
   x1: 2
@@ -1568,7 +1568,7 @@ foo2: 12
 
     // we can parse directly into a node nested deep in an existing tree:
     ryml::parse_in_arena("{champagne: Dom Perignon, coffee: Arabica}", root.append_child());
-    CHECK(ryml::emitrs<std::string>(tree) == R"(- a
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(- a
 - b
 - x0: 1
   x1: 2
@@ -1590,7 +1590,7 @@ foo2: 12
     ryml::NodeRef beer = root[3].append_child({ryml::KEYSEQ, "beer"});
     ryml::parse_in_arena("{vinho verde: Soalheiro, vinho tinto: Redoma 2017}", more);
     ryml::parse_in_arena("[Rochefort 10, Busch, Leffe Rituel]", beer);
-    CHECK(ryml::emitrs<std::string>(tree) == R"(- a
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(- a
 - b
 - x0: 1
   x1: 2
@@ -1606,7 +1606,7 @@ foo2: 12
 )");
 
     ryml::parse_in_arena("[foo, bar, baz, bat]", root);
-    CHECK(ryml::emitrs<std::string>(tree) == R"(- a
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(- a
 - b
 - x0: 1
   x1: 2
@@ -1626,7 +1626,7 @@ foo2: 12
 )");
 
     ryml::parse_in_arena("[Kasteel Donker]", beer);
-    CHECK(ryml::emitrs<std::string>(tree) == R"(- a
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(- a
 - b
 - x0: 1
   x1: 2
@@ -1666,14 +1666,14 @@ void sample_parse_reuse_parser()
                               // because it is above 16.
 
     auto champagnes = parser.parse_in_arena("champagnes.yml", "[Dom Perignon, Gosset Grande Reserve, Ruinart Blanc de Blancs, Jacquesson 742]");
-    CHECK(ryml::emitrs<std::string>(champagnes) == R"(- Dom Perignon
+    CHECK(ryml::emitrs_yaml<std::string>(champagnes) == R"(- Dom Perignon
 - Gosset Grande Reserve
 - Ruinart Blanc de Blancs
 - Jacquesson 742
 )");
 
     auto beers = parser.parse_in_arena("beers.yml", "[Rochefort 10, Busch, Leffe Rituel, Kasteel Donker]");
-    CHECK(ryml::emitrs<std::string>(beers) == R"(- Rochefort 10
+    CHECK(ryml::emitrs_yaml<std::string>(beers) == R"(- Rochefort 10
 - Busch
 - Leffe Rituel
 - Kasteel Donker
@@ -1710,7 +1710,7 @@ void sample_parse_reuse_tree_and_parser()
     ryml::csubstr wines = "[Soalheiro, Niepoort Redoma 2017, Vina Esmeralda]";
 
     parser.parse_in_arena("champagnes.yml", champagnes, &tree);
-    CHECK(ryml::emitrs<std::string>(tree) == R"(- Dom Perignon
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(- Dom Perignon
 - Gosset Grande Reserve
 - Ruinart Blanc de Blancs
 - Jacquesson 742
@@ -1718,7 +1718,7 @@ void sample_parse_reuse_tree_and_parser()
 
     // watchout: this will APPEND to the given tree:
     parser.parse_in_arena("beers.yml", beers, &tree);
-    CHECK(ryml::emitrs<std::string>(tree) == R"(- Dom Perignon
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(- Dom Perignon
 - Gosset Grande Reserve
 - Ruinart Blanc de Blancs
 - Jacquesson 742
@@ -1731,7 +1731,7 @@ void sample_parse_reuse_tree_and_parser()
     // if you don't wish to append, clear the tree first:
     tree.clear();
     parser.parse_in_arena("wines.yml", wines, &tree);
-    CHECK(ryml::emitrs<std::string>(tree) == R"(- Soalheiro
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(- Soalheiro
 - Niepoort Redoma 2017
 - Vina Esmeralda
 )");
@@ -1858,7 +1858,7 @@ void sample_create_trees()
     root["cars"] = "GTO";
 
     std::cout << tree;
-    CHECK(ryml::emitrs<std::string>(tree) == R"(doe: 'a deer, a female deer'
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"(doe: 'a deer, a female deer'
 ray: a drop of golden sun
 pi: 3.14159
 xmas: true
@@ -2583,7 +2583,7 @@ void sample_base64()
         tree.rootref().append_child() << ryml::key(ryml::fmt::base64(c.text)) << c.text;
         CHECK(tree[c.base64].val() == c.text);
     }
-    CHECK(ryml::emitrs<std::string>(tree) == R"('Love all, trust a few, do wrong to none.': TG92ZSBhbGwsIHRydXN0IGEgZmV3LCBkbyB3cm9uZyB0byBub25lLg==
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"('Love all, trust a few, do wrong to none.': TG92ZSBhbGwsIHRydXN0IGEgZmV3LCBkbyB3cm9uZyB0byBub25lLg==
 'The fool doth think he is wise, but the wise man knows himself to be a fool.': VGhlIGZvb2wgZG90aCB0aGluayBoZSBpcyB3aXNlLCBidXQgdGhlIHdpc2UgbWFuIGtub3dzIGhpbXNlbGYgdG8gYmUgYSBmb29sLg==
 Brevity is the soul of wit.: QnJldml0eSBpcyB0aGUgc291bCBvZiB3aXQu
 All that glitters is not gold.: QWxsIHRoYXQgZ2xpdHRlcnMgaXMgbm90IGdvbGQu
@@ -2739,7 +2739,7 @@ void sample_user_scalar_types()
     CHECK(v4in.y == v4out.y);
     CHECK(v4in.z == v4out.z);
     CHECK(v4in.w == v4out.w);
-    CHECK(ryml::emitrs<std::string>(t) == R"(v2: '(10,11)'
+    CHECK(ryml::emitrs_yaml<std::string>(t) == R"(v2: '(10,11)'
 v3: '(100,101,102)'
 v4: '(1000,1001,1002,1003)'
 )");
@@ -2767,7 +2767,7 @@ v4: '(1000,1001,1002,1003)'
     CHECK(eov4in.x == pov4out.x);
     CHECK(eov4in.y == pov4out.y);
     CHECK(eov4in.z == pov4out.z);
-    CHECK(ryml::emitrs<std::string>(t) == R"(v2: '(20,21)'
+    CHECK(ryml::emitrs_yaml<std::string>(t) == R"(v2: '(20,21)'
 v3: '(30,31,32)'
 v4: '(40,41,42,43)'
 )");
@@ -2896,7 +2896,7 @@ void sample_user_container_types()
         CHECK(mt_out.map.map_member.find(kv.first) != mt_out.map.map_member.end());
         CHECK(mt_out.map.map_member[kv.first] == kv.second);
     }
-    CHECK(ryml::emitrs<std::string>(t) == R"(v2: '(20,21)'
+    CHECK(ryml::emitrs_yaml<std::string>(t) == R"(v2: '(20,21)'
 v3: '(30,31,32)'
 v4: '(40,41,42,43)'
 seq:
@@ -2984,7 +2984,7 @@ void sample_std_types()
     CHECK(vmt.size() == 3);
     ryml::Tree tree_out;
     tree_out.rootref() << vmt;
-    CHECK(ryml::emitrs<std::string>(tree_out) == yml_std_string);
+    CHECK(ryml::emitrs_yaml<std::string>(tree_out) == yml_std_string);
 }
 
 
@@ -3022,39 +3022,39 @@ void sample_emit_to_container()
         // do a blank call on an empty buffer to find the required size.
         // no overflow will occur, and returns a substr with the size
         // required to output
-        ryml::csubstr output = ryml::emit(treea, treea.root_id(), ryml::substr{}, /*error_on_excess*/false);
+        ryml::csubstr output = ryml::emit_yaml(treea, treea.root_id(), ryml::substr{}, /*error_on_excess*/false);
         CHECK(output.str == nullptr);
         CHECK(output.len > 0);
         size_t num_needed_chars = output.len;
         std::vector<char> buf(num_needed_chars);
         // now try again with the proper buffer
-        output = ryml::emit(treea, treea.root_id(), ryml::to_substr(buf), /*error_on_excess*/true);
+        output = ryml::emit_yaml(treea, treea.root_id(), ryml::to_substr(buf), /*error_on_excess*/true);
         CHECK(output == ymla);
 
         // it is possible to reuse the buffer and grow it as needed.
         // first do a blank run to find the size:
-        output = ryml::emit(treeb, treeb.root_id(), ryml::substr{}, /*error_on_excess*/false);
+        output = ryml::emit_yaml(treeb, treeb.root_id(), ryml::substr{}, /*error_on_excess*/false);
         CHECK(output.str == nullptr);
         CHECK(output.len > 0);
         CHECK(output.len == ymlb.len);
         num_needed_chars = output.len;
         buf.resize(num_needed_chars);
         // now try again with the proper buffer
-        output = ryml::emit(treeb, treeb.root_id(), ryml::to_substr(buf), /*error_on_excess*/true);
+        output = ryml::emit_yaml(treeb, treeb.root_id(), ryml::to_substr(buf), /*error_on_excess*/true);
         CHECK(output == ymlb);
 
         // there is a convenience wrapper performing the same as above:
         // provided to_substr() is defined for that container.
-        output = ryml::emitrs(treeb, &buf);
+        output = ryml::emitrs_yaml(treeb, &buf);
         CHECK(output == ymlb);
 
         // or you can just output a new container:
         // provided to_substr() is defined for that container.
-        std::vector<char> another = ryml::emitrs<std::vector<char>>(treeb);
+        std::vector<char> another = ryml::emitrs_yaml<std::vector<char>>(treeb);
         CHECK(ryml::to_csubstr(another) == ymlb);
 
         // you can also emit nested nodes:
-        another = ryml::emitrs<std::vector<char>>(treeb[3][2]);
+        another = ryml::emitrs_yaml<std::vector<char>>(treeb[3][2]);
         CHECK(ryml::to_csubstr(another) == R"(more:
   vinho verde: Soalheiro
   vinho tinto: Redoma 2017
@@ -3067,40 +3067,40 @@ void sample_emit_to_container()
         // do a blank call on an empty buffer to find the required size.
         // no overflow will occur, and returns a substr with the size
         // required to output
-        ryml::csubstr output = ryml::emit(treea, treea.root_id(), ryml::substr{}, /*error_on_excess*/false);
+        ryml::csubstr output = ryml::emit_yaml(treea, treea.root_id(), ryml::substr{}, /*error_on_excess*/false);
         CHECK(output.str == nullptr);
         CHECK(output.len > 0);
         size_t num_needed_chars = output.len;
         std::string buf;
         buf.resize(num_needed_chars);
         // now try again with the proper buffer
-        output = ryml::emit(treea, treea.root_id(), ryml::to_substr(buf), /*error_on_excess*/true);
+        output = ryml::emit_yaml(treea, treea.root_id(), ryml::to_substr(buf), /*error_on_excess*/true);
         CHECK(output == ymla);
 
         // it is possible to reuse the buffer and grow it as needed.
         // first do a blank run to find the size:
-        output = ryml::emit(treeb, treeb.root_id(), ryml::substr{}, /*error_on_excess*/false);
+        output = ryml::emit_yaml(treeb, treeb.root_id(), ryml::substr{}, /*error_on_excess*/false);
         CHECK(output.str == nullptr);
         CHECK(output.len > 0);
         CHECK(output.len == ymlb.len);
         num_needed_chars = output.len;
         buf.resize(num_needed_chars);
         // now try again with the proper buffer
-        output = ryml::emit(treeb, treeb.root_id(), ryml::to_substr(buf), /*error_on_excess*/true);
+        output = ryml::emit_yaml(treeb, treeb.root_id(), ryml::to_substr(buf), /*error_on_excess*/true);
         CHECK(output == ymlb);
 
         // there is a convenience wrapper performing the above instructions:
         // provided to_substr() is defined for that container
-        output = ryml::emitrs(treeb, &buf);
+        output = ryml::emitrs_yaml(treeb, &buf);
         CHECK(output == ymlb);
 
         // or you can just output a new container:
         // provided to_substr() is defined for that container.
-        std::string another = ryml::emitrs<std::string>(treeb);
+        std::string another = ryml::emitrs_yaml<std::string>(treeb);
         CHECK(ryml::to_csubstr(another) == ymlb);
 
         // you can also emit nested nodes:
-        another = ryml::emitrs<std::string>(treeb[3][2]);
+        another = ryml::emitrs_yaml<std::string>(treeb[3][2]);
         CHECK(ryml::to_csubstr(another) == R"(more:
   vinho verde: Soalheiro
   vinho tinto: Redoma 2017
@@ -3199,7 +3199,7 @@ void sample_emit_to_file()
     auto tree = ryml::parse_in_arena(yml);
     // this is emitting to stdout, but of course you can pass in any
     // FILE* obtained from fopen()
-    size_t len = ryml::emit(tree, tree.root_id(), stdout);
+    size_t len = ryml::emit_yaml(tree, tree.root_id(), stdout);
     // the return value is the number of characters that were written
     // to the file
     CHECK(len == yml.len);
@@ -3232,7 +3232,7 @@ void sample_emit_nested_node()
 - members
 - here
 )");
-    CHECK(ryml::emitrs<std::string>(tree[3]["beer"]) == R"(beer:
+    CHECK(ryml::emitrs_yaml<std::string>(tree[3]["beer"]) == R"(beer:
   - Rochefort 10
   - Busch
   - Leffe Rituel
@@ -3240,8 +3240,8 @@ void sample_emit_nested_node()
     - many other
     - wonderful beers
 )");
-    CHECK(ryml::emitrs<std::string>(tree[3]["beer"][0]) == "Rochefort 10\n");
-    CHECK(ryml::emitrs<std::string>(tree[3]["beer"][3]) == R"(- and so
+    CHECK(ryml::emitrs_yaml<std::string>(tree[3]["beer"][0]) == "Rochefort 10\n");
+    CHECK(ryml::emitrs_yaml<std::string>(tree[3]["beer"][3]) == R"(- and so
 - many other
 - wonderful beers
 )");
@@ -3263,7 +3263,7 @@ void sample_json()
 "far":"a long long way to go"
 })");
     // However, emitting still defaults to YAML
-    CHECK(ryml::emitrs<std::string>(tree) == R"('doe': 'a deer, a female deer'
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == R"('doe': 'a deer, a female deer'
 'ray': 'a drop of golden sun'
 'me': 'a name, I call myself'
 'far': 'a long long way to go'
@@ -3423,7 +3423,7 @@ a: b
 - !!str 0
 )";
     ryml::Tree tree = ryml::parse_in_arena(ryml::to_csubstr(unresolved));
-    CHECK(ryml::emitrs<std::string>(tree) == resolved);
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == resolved);
     const ryml::ConstNodeRef stream = tree.rootref();
     CHECK(stream.is_stream());
     CHECK(stream.num_children() == 13);
@@ -3450,7 +3450,7 @@ d: 3
 - 7
 )";
     ryml::Tree tree = ryml::parse_in_place(ryml::to_substr(yml));
-    CHECK(ryml::emitrs<std::string>(tree) == yml);
+    CHECK(ryml::emitrs_yaml<std::string>(tree) == yml);
 
     // iteration through docs
     {
diff --git a/src/c4/yml/emit.def.hpp b/src/c4/yml/emit.def.hpp
index 4aa03c112..4f61d0ada 100644
--- a/src/c4/yml/emit.def.hpp
+++ b/src/c4/yml/emit.def.hpp
@@ -9,7 +9,7 @@ namespace c4 {
 namespace yml {
 
 template<class Writer>
-substr Emitter<Writer>::emit(EmitType_e type, Tree const& t, size_t id, bool error_on_excess)
+substr Emitter<Writer>::emit_as(EmitType_e type, Tree const& t, size_t id, bool error_on_excess)
 {
     if(t.empty())
     {
@@ -28,18 +28,18 @@ substr Emitter<Writer>::emit(EmitType_e type, Tree const& t, size_t id, bool err
 }
 
 template<class Writer>
-substr Emitter<Writer>::emit(EmitType_e type, Tree const& t, bool error_on_excess)
+substr Emitter<Writer>::emit_as(EmitType_e type, Tree const& t, bool error_on_excess)
 {
     if(t.empty())
         return {};
-    return emit(type, t, t.root_id(), error_on_excess);
+    return this->emit_as(type, t, t.root_id(), error_on_excess);
 }
 
 template<class Writer>
-substr Emitter<Writer>::emit(EmitType_e type, ConstNodeRef const& n, bool error_on_excess)
+substr Emitter<Writer>::emit_as(EmitType_e type, ConstNodeRef const& n, bool error_on_excess)
 {
     _RYML_CB_CHECK(n.tree()->callbacks(), n.valid());
-    return emit(type, *n.tree(), n.id(), error_on_excess);
+    return this->emit_as(type, *n.tree(), n.id(), error_on_excess);
 }
 
 
diff --git a/src/c4/yml/emit.hpp b/src/c4/yml/emit.hpp
index 166837633..0c4804869 100644
--- a/src/c4/yml/emit.hpp
+++ b/src/c4/yml/emit.hpp
@@ -13,6 +13,22 @@
 #include "./node.hpp"
 #endif
 
+
+#define RYML_DEPRECATE_EMIT                                             \
+    RYML_DEPRECATED("use emit_yaml() instead. See https://github.com/biojppm/rapidyaml/issues/120")
+
+#define RYML_DEPRECATE_EMITRS                                           \
+    RYML_DEPRECATED("use emitrs_yaml() instead. See https://github.com/biojppm/rapidyaml/issues/120")
+
+#ifdef emit
+#error "emit is defined, likely from a Qt include. This will cause a compilation error. See https://github.com/biojppm/rapidyaml/issues/120"
+#endif
+
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
 namespace c4 {
 namespace yml {
 
@@ -60,11 +76,11 @@ class Emitter : public Writer
      *
      * When writing to a file, the returned substr will be null, but its
      * length will be set to the number of bytes written. */
-    substr emit(EmitType_e type, Tree const& t, size_t id, bool error_on_excess);
+    substr emit_as(EmitType_e type, Tree const& t, size_t id, bool error_on_excess);
     /** emit starting at the root node */
-    substr emit(EmitType_e type, Tree const& t, bool error_on_excess=true);
+    substr emit_as(EmitType_e type, Tree const& t, bool error_on_excess=true);
     /** emit the given node */
-    substr emit(EmitType_e type, ConstNodeRef const& n, bool error_on_excess=true);
+    substr emit_as(EmitType_e type, ConstNodeRef const& n, bool error_on_excess=true);
 
 private:
 
@@ -120,27 +136,36 @@ class Emitter : public Writer
 
 /** emit YAML to the given file. A null file defaults to stdout.
  * Return the number of bytes written. */
-inline size_t emit(Tree const& t, size_t id, FILE *f)
+inline size_t emit_yaml(Tree const& t, size_t id, FILE *f)
 {
     EmitterFile em(f);
-    return em.emit(EMIT_YAML, t, id, /*error_on_excess*/true).len;
+    return em.emit_as(EMIT_YAML, t, id, /*error_on_excess*/true).len;
 }
+RYML_DEPRECATE_EMIT inline size_t emit(Tree const& t, size_t id, FILE *f)
+{
+    return emit_yaml(t, id, f);
+}
+
 /** emit JSON to the given file. A null file defaults to stdout.
  * Return the number of bytes written. */
 inline size_t emit_json(Tree const& t, size_t id, FILE *f)
 {
     EmitterFile em(f);
-    return em.emit(EMIT_JSON, t, id, /*error_on_excess*/true).len;
+    return em.emit_as(EMIT_JSON, t, id, /*error_on_excess*/true).len;
 }
 
 
 /** emit YAML to the given file. A null file defaults to stdout.
  * Return the number of bytes written.
  * @overload */
-inline size_t emit(Tree const& t, FILE *f=nullptr)
+inline size_t emit_yaml(Tree const& t, FILE *f=nullptr)
 {
     EmitterFile em(f);
-    return em.emit(EMIT_YAML, t, /*error_on_excess*/true).len;
+    return em.emit_as(EMIT_YAML, t, /*error_on_excess*/true).len;
+}
+RYML_DEPRECATE_EMIT inline size_t emit(Tree const& t, FILE *f=nullptr)
+{
+    return emit_yaml(t, f);
 }
 
 /** emit JSON to the given file. A null file defaults to stdout.
@@ -149,17 +174,21 @@ inline size_t emit(Tree const& t, FILE *f=nullptr)
 inline size_t emit_json(Tree const& t, FILE *f=nullptr)
 {
     EmitterFile em(f);
-    return em.emit(EMIT_JSON, t, /*error_on_excess*/true).len;
+    return em.emit_as(EMIT_JSON, t, /*error_on_excess*/true).len;
 }
 
 
 /** emit YAML to the given file. A null file defaults to stdout.
  * Return the number of bytes written.
  * @overload */
-inline size_t emit(ConstNodeRef const& r, FILE *f=nullptr)
+inline size_t emit_yaml(ConstNodeRef const& r, FILE *f=nullptr)
 {
     EmitterFile em(f);
-    return em.emit(EMIT_YAML, r, /*error_on_excess*/true).len;
+    return em.emit_as(EMIT_YAML, r, /*error_on_excess*/true).len;
+}
+RYML_DEPRECATE_EMIT inline size_t emit(ConstNodeRef const& r, FILE *f=nullptr)
+{
+    return emit_yaml(r, f);
 }
 
 /** emit JSON to the given file. A null file defaults to stdout.
@@ -168,7 +197,7 @@ inline size_t emit(ConstNodeRef const& r, FILE *f=nullptr)
 inline size_t emit_json(ConstNodeRef const& r, FILE *f=nullptr)
 {
     EmitterFile em(f);
-    return em.emit(EMIT_JSON, r, /*error_on_excess*/true).len;
+    return em.emit_as(EMIT_JSON, r, /*error_on_excess*/true).len;
 }
 
 
@@ -179,7 +208,7 @@ template<class OStream>
 inline OStream& operator<< (OStream& s, Tree const& t)
 {
     EmitterOStream<OStream> em(s);
-    em.emit(EMIT_YAML, t);
+    em.emit_as(EMIT_YAML, t);
     return s;
 }
 
@@ -189,7 +218,7 @@ template<class OStream>
 inline OStream& operator<< (OStream& s, ConstNodeRef const& n)
 {
     EmitterOStream<OStream> em(s);
-    em.emit(EMIT_YAML, n);
+    em.emit_as(EMIT_YAML, n);
     return s;
 }
 
@@ -198,7 +227,7 @@ template<class OStream>
 inline OStream& operator<< (OStream& s, as_json const& j)
 {
     EmitterOStream<OStream> em(s);
-    em.emit(EMIT_JSON, *j.tree, j.node, true);
+    em.emit_as(EMIT_JSON, *j.tree, j.node, true);
     return s;
 }
 
@@ -209,10 +238,14 @@ inline OStream& operator<< (OStream& s, as_json const& j)
 /** emit YAML to the given buffer. Return a substr trimmed to the emitted YAML.
  * @param error_on_excess Raise an error if the space in the buffer is insufficient.
  * @overload */
-inline substr emit(Tree const& t, size_t id, substr buf, bool error_on_excess=true)
+inline substr emit_yaml(Tree const& t, size_t id, substr buf, bool error_on_excess=true)
 {
     EmitterBuf em(buf);
-    return em.emit(EMIT_YAML, t, id, error_on_excess);
+    return em.emit_as(EMIT_YAML, t, id, error_on_excess);
+}
+RYML_DEPRECATE_EMIT inline substr emit(Tree const& t, size_t id, substr buf, bool error_on_excess=true)
+{
+    return emit_yaml(t, id, buf, error_on_excess);
 }
 
 /** emit JSON to the given buffer. Return a substr trimmed to the emitted JSON.
@@ -221,17 +254,21 @@ inline substr emit(Tree const& t, size_t id, substr buf, bool error_on_excess=tr
 inline substr emit_json(Tree const& t, size_t id, substr buf, bool error_on_excess=true)
 {
     EmitterBuf em(buf);
-    return em.emit(EMIT_JSON, t, id, error_on_excess);
+    return em.emit_as(EMIT_JSON, t, id, error_on_excess);
 }
 
 
 /** emit YAML to the given buffer. Return a substr trimmed to the emitted YAML.
  * @param error_on_excess Raise an error if the space in the buffer is insufficient.
  * @overload */
-inline substr emit(Tree const& t, substr buf, bool error_on_excess=true)
+inline substr emit_yaml(Tree const& t, substr buf, bool error_on_excess=true)
 {
     EmitterBuf em(buf);
-    return em.emit(EMIT_YAML, t, error_on_excess);
+    return em.emit_as(EMIT_YAML, t, error_on_excess);
+}
+RYML_DEPRECATE_EMIT inline substr emit(Tree const& t, substr buf, bool error_on_excess=true)
+{
+    return emit_yaml(t, buf, error_on_excess);
 }
 
 /** emit JSON to the given buffer. Return a substr trimmed to the emitted JSON.
@@ -240,7 +277,7 @@ inline substr emit(Tree const& t, substr buf, bool error_on_excess=true)
 inline substr emit_json(Tree const& t, substr buf, bool error_on_excess=true)
 {
     EmitterBuf em(buf);
-    return em.emit(EMIT_JSON, t, error_on_excess);
+    return em.emit_as(EMIT_JSON, t, error_on_excess);
 }
 
 
@@ -248,10 +285,14 @@ inline substr emit_json(Tree const& t, substr buf, bool error_on_excess=true)
  * @param error_on_excess Raise an error if the space in the buffer is insufficient.
  * @overload
  */
-inline substr emit(ConstNodeRef const& r, substr buf, bool error_on_excess=true)
+inline substr emit_yaml(ConstNodeRef const& r, substr buf, bool error_on_excess=true)
 {
     EmitterBuf em(buf);
-    return em.emit(EMIT_YAML, r, error_on_excess);
+    return em.emit_as(EMIT_YAML, r, error_on_excess);
+}
+RYML_DEPRECATE_EMIT inline substr emit(ConstNodeRef const& r, substr buf, bool error_on_excess=true)
+{
+    return emit_yaml(r, buf, error_on_excess);
 }
 
 /** emit JSON to the given buffer. Return a substr trimmed to the emitted JSON.
@@ -261,7 +302,7 @@ inline substr emit(ConstNodeRef const& r, substr buf, bool error_on_excess=true)
 inline substr emit_json(ConstNodeRef const& r, substr buf, bool error_on_excess=true)
 {
     EmitterBuf em(buf);
-    return em.emit(EMIT_JSON, r, error_on_excess);
+    return em.emit_as(EMIT_JSON, r, error_on_excess);
 }
 
 
@@ -270,18 +311,23 @@ inline substr emit_json(ConstNodeRef const& r, substr buf, bool error_on_excess=
 /** emit+resize: emit YAML to the given std::string/std::vector-like
  * container, resizing it as needed to fit the emitted YAML. */
 template<class CharOwningContainer>
-substr emitrs(Tree const& t, size_t id, CharOwningContainer * cont)
+substr emitrs_yaml(Tree const& t, size_t id, CharOwningContainer * cont)
 {
     substr buf = to_substr(*cont);
-    substr ret = emit(t, id, buf, /*error_on_excess*/false);
+    substr ret = emit_yaml(t, id, buf, /*error_on_excess*/false);
     if(ret.str == nullptr && ret.len > 0)
     {
         cont->resize(ret.len);
         buf = to_substr(*cont);
-        ret = emit(t, id, buf, /*error_on_excess*/true);
+        ret = emit_yaml(t, id, buf, /*error_on_excess*/true);
     }
     return ret;
 }
+template<class CharOwningContainer>
+RYML_DEPRECATE_EMITRS substr emitrs(Tree const& t, size_t id, CharOwningContainer * cont)
+{
+    return emitrs_yaml(t, id, cont);
+}
 
 /** emit+resize: emit JSON to the given std::string/std::vector-like
  * container, resizing it as needed to fit the emitted JSON. */
@@ -303,15 +349,22 @@ substr emitrs_json(Tree const& t, size_t id, CharOwningContainer * cont)
 /** emit+resize: emit YAML to the given std::string/std::vector-like
  * container, resizing it as needed to fit the emitted YAML. */
 template<class CharOwningContainer>
-CharOwningContainer emitrs(Tree const& t, size_t id)
+CharOwningContainer emitrs_yaml(Tree const& t, size_t id)
 {
     CharOwningContainer c;
-    emitrs(t, id, &c);
+    emitrs_yaml(t, id, &c);
+    return c;
+}
+template<class CharOwningContainer>
+RYML_DEPRECATE_EMITRS CharOwningContainer emitrs(Tree const& t, size_t id)
+{
+    CharOwningContainer c;
+    emitrs_yaml(t, id, &c);
     return c;
 }
 
-/** emit+resize: emit JSON to the given std::string/std::vector-like container,
- * resizing it as needed to fit the emitted JSON. */
+/** emit+resize: emit JSON to the given std::string/std::vector-like
+ * container, resizing it as needed to fit the emitted JSON. */
 template<class CharOwningContainer>
 CharOwningContainer emitrs_json(Tree const& t, size_t id)
 {
@@ -321,18 +374,23 @@ CharOwningContainer emitrs_json(Tree const& t, size_t id)
 }
 
 
-/** emit+resize: YAML to the given std::string/std::vector-like container,
- * resizing it as needed to fit the emitted YAML. */
+/** emit+resize: YAML to the given std::string/std::vector-like
+ * container, resizing it as needed to fit the emitted YAML. */
 template<class CharOwningContainer>
-substr emitrs(Tree const& t, CharOwningContainer * cont)
+substr emitrs_yaml(Tree const& t, CharOwningContainer * cont)
 {
     if(t.empty())
         return {};
-    return emitrs(t, t.root_id(), cont);
+    return emitrs_yaml(t, t.root_id(), cont);
+}
+template<class CharOwningContainer>
+RYML_DEPRECATE_EMITRS substr emitrs(Tree const& t, CharOwningContainer * cont)
+{
+    return emitrs_yaml(t, cont);
 }
 
-/** emit+resize: JSON to the given std::string/std::vector-like container,
- * resizing it as needed to fit the emitted JSON. */
+/** emit+resize: JSON to the given std::string/std::vector-like
+ * container, resizing it as needed to fit the emitted JSON. */
 template<class CharOwningContainer>
 substr emitrs_json(Tree const& t, CharOwningContainer * cont)
 {
@@ -345,14 +403,19 @@ substr emitrs_json(Tree const& t, CharOwningContainer * cont)
 /** emit+resize: YAML to the given std::string/std::vector-like container,
  * resizing it as needed to fit the emitted YAML. */
 template<class CharOwningContainer>
-CharOwningContainer emitrs(Tree const& t)
+CharOwningContainer emitrs_yaml(Tree const& t)
 {
     CharOwningContainer c;
     if(t.empty())
         return c;
-    emitrs(t, t.root_id(), &c);
+    emitrs_yaml(t, t.root_id(), &c);
     return c;
 }
+template<class CharOwningContainer>
+RYML_DEPRECATE_EMITRS CharOwningContainer emitrs(Tree const& t)
+{
+    return emitrs_yaml<CharOwningContainer>(t);
+}
 
 /** emit+resize: JSON to the given std::string/std::vector-like container,
  * resizing it as needed to fit the emitted JSON. */
@@ -370,10 +433,15 @@ CharOwningContainer emitrs_json(Tree const& t)
 /** emit+resize: YAML to the given std::string/std::vector-like container,
  * resizing it as needed to fit the emitted YAML. */
 template<class CharOwningContainer>
-substr emitrs(ConstNodeRef const& n, CharOwningContainer * cont)
+substr emitrs_yaml(ConstNodeRef const& n, CharOwningContainer * cont)
 {
     _RYML_CB_CHECK(n.tree()->callbacks(), n.valid());
-    return emitrs(*n.tree(), n.id(), cont);
+    return emitrs_yaml(*n.tree(), n.id(), cont);
+}
+template<class CharOwningContainer>
+RYML_DEPRECATE_EMITRS substr emitrs(ConstNodeRef const& n, CharOwningContainer * cont)
+{
+    return emitrs_yaml(n, cont);
 }
 
 /** emit+resize: JSON to the given std::string/std::vector-like container,
@@ -389,13 +457,18 @@ substr emitrs_json(ConstNodeRef const& n, CharOwningContainer * cont)
 /** emit+resize: YAML to the given std::string/std::vector-like container,
  * resizing it as needed to fit the emitted YAML. */
 template<class CharOwningContainer>
-CharOwningContainer emitrs(ConstNodeRef const& n)
+CharOwningContainer emitrs_yaml(ConstNodeRef const& n)
 {
     _RYML_CB_CHECK(n.tree()->callbacks(), n.valid());
     CharOwningContainer c;
-    emitrs(*n.tree(), n.id(), &c);
+    emitrs_yaml(*n.tree(), n.id(), &c);
     return c;
 }
+template<class CharOwningContainer>
+RYML_DEPRECATE_EMITRS CharOwningContainer emitrs(ConstNodeRef const& n)
+{
+    return emitrs_yaml<CharOwningContainer>(n);
+}
 
 /** emit+resize: JSON to the given std::string/std::vector-like container,
  * resizing it as needed to fit the emitted JSON. */
@@ -411,6 +484,9 @@ CharOwningContainer emitrs_json(ConstNodeRef const& n)
 } // namespace yml
 } // namespace c4
 
+#undef RYML_DEPRECATE_EMIT
+#undef RYML_DEPRECATE_EMITRS
+
 #include "c4/yml/emit.def.hpp"
 
 #endif /* _C4_YML_EMIT_HPP_ */
diff --git a/tools/parse_emit.cpp b/tools/parse_emit.cpp
index 453935d48..4c028f8d5 100644
--- a/tools/parse_emit.cpp
+++ b/tools/parse_emit.cpp
@@ -78,7 +78,7 @@ int main(int argc, const char *argv[])
         {
             TS(emit_to_buffer);
             output.resize(contents.size()); // resize, not just reserve
-            yml::emitrs(tree, &output);
+            yml::emitrs_yaml(tree, &output);
         }
         {
             TS(print_stdout);


Test patch:
diff --git a/test/test_basic.cpp b/test/test_basic.cpp
index 56e580296..7a10c073b 100644
--- a/test/test_basic.cpp
+++ b/test/test_basic.cpp
@@ -63,7 +63,7 @@ TEST(general, emitting)
     //print_tree(tree);
 
     // emit to stdout (can also emit to FILE* or ryml::span)
-    emitrs(tree, &cmpbuf);
+    emitrs_yaml(tree, &cmpbuf);
     const char* exp = R"(foo: 1
 seq:
   - bar0
@@ -88,7 +88,7 @@ TEST(general, emitting)
         // knows how to turn an std::string into a c4::csubstr/c4::substr.
     }
 
-    emitrs(tree, &cmpbuf);
+    emitrs_yaml(tree, &cmpbuf);
     exp = R"(foo: 1
 seq:
   - bar0
@@ -104,7 +104,7 @@ TEST(general, emitting)
     int k=66;
     r.append_child() << key(k) << 7;
 
-    emitrs(tree, &cmpbuf);
+    emitrs_yaml(tree, &cmpbuf);
     exp = R"(foo: 1
 seq:
   - bar0
@@ -125,7 +125,7 @@ TEST(general, map_to_root)
     Tree t;
     t.rootref() << m;
 
-    emitrs(t, &cmpbuf);
+    emitrs_yaml(t, &cmpbuf);
     exp = R"(bar: 2
 foo: 1
 )";
@@ -173,7 +173,7 @@ TEST(general, numbers)
 - 1e+2
 )";
     Tree t = parse_in_arena(yaml);
-    auto s = emitrs<std::string>(t);
+    auto s = emitrs_yaml<std::string>(t);
     EXPECT_EQ(s, std::string(yaml));
 }
 
@@ -201,7 +201,7 @@ TEST(general, newlines_on_maps_nested_in_seqs)
     species: BokoblinSeries
 )";
     Tree t = parse_in_arena(yaml);
-    auto s = emitrs<std::string>(t);
+    auto s = emitrs_yaml<std::string>(t);
     EXPECT_EQ(expected, s);
 }
 
@@ -277,7 +277,7 @@ TEST(general, github_issue_124)
     {
         SCOPED_TRACE(inp);
         Tree t = parse_in_arena(inp);
-        std::string s = emitrs<std::string>(t);
+        std::string s = emitrs_yaml<std::string>(t);
         // The re-emitted output should not contain the comment.
         EXPECT_EQ(c4::to_csubstr(s), "a:\n  - b\nc: d\n");
     }
diff --git a/test/test_block_literal.cpp b/test/test_block_literal.cpp
index d56d484ba..f43d2b731 100644
--- a/test/test_block_literal.cpp
+++ b/test/test_block_literal.cpp
@@ -69,19 +69,19 @@ TEST(block_literal, emit_does_not_add_lines_to_multi_at_end_1)
     r.append_child() = "\n\n";
     r.append_child() = "\n\n";
     r.append_child() = "last";
-    std::string out = emitrs<std::string>(t);
+    std::string out = emitrs_yaml<std::string>(t);
     t.clear();
     t = parse_in_arena(to_csubstr(out));
     EXPECT_EQ(t[0].val(), csubstr("\n\n"));
     EXPECT_EQ(t[1].val(), csubstr("\n\n"));
     EXPECT_EQ(t[2].val(), csubstr("last"));
-    out = emitrs<std::string>(t);
+    out = emitrs_yaml<std::string>(t);
     t.clear();
     t = parse_in_arena(to_csubstr(out));
     EXPECT_EQ(t[0].val(), csubstr("\n\n"));
     EXPECT_EQ(t[1].val(), csubstr("\n\n"));
     EXPECT_EQ(t[2].val(), csubstr("last"));
-    out = emitrs<std::string>(t);
+    out = emitrs_yaml<std::string>(t);
     t.clear();
     t = parse_in_arena(to_csubstr(out));
     EXPECT_EQ(t[0].val(), csubstr("\n\n"));
@@ -104,15 +104,15 @@ TEST(block_literal, emit_does_not_add_lines_to_multi_at_end_2)
    
 
 )";
-    std::string out = emitrs<std::string>(t);
+    std::string out = emitrs_yaml<std::string>(t);
     EXPECT_EQ(out, expected);
     t = parse_in_arena(to_csubstr(out));
     EXPECT_EQ(t.docref(0).val(), csubstr("ab\n\n \n"));
-    out = emitrs<std::string>(t);
+    out = emitrs_yaml<std::string>(t);
     EXPECT_EQ(out, expected);
     t = parse_in_arena(to_csubstr(out));
     EXPECT_EQ(t.docref(0).val(), csubstr("ab\n\n \n"));
-    out = emitrs<std::string>(t);
+    out = emitrs_yaml<std::string>(t);
     EXPECT_EQ(out, expected);
     t = parse_in_arena(to_csubstr(out));
     EXPECT_EQ(t.docref(0).val(), csubstr("ab\n\n \n"));
@@ -158,12 +158,12 @@ TEST(block_literal, emit_does_not_add_lines_to_multi_at_end_3)
     Tree t = parse_in_arena(to_csubstr(yaml));
     EXPECT_EQ(t[0].val(), "Several lines of text,\nwith some \"quotes\" of various 'types',\nand also a blank line:\n\nplus another line at the end.\n");
     EXPECT_EQ(t[1].val(), "Several lines of text,\nwith some \"quotes\" of various 'types',\nand also a blank line:\n\nplus another line at the end.\n\n");
-    std::string out = emitrs<std::string>(t);
+    std::string out = emitrs_yaml<std::string>(t);
     EXPECT_EQ(out, expected);
     t = parse_in_arena(to_csubstr(out));
     EXPECT_EQ(t[0].val(), "Several lines of text,\nwith some \"quotes\" of various 'types',\nand also a blank line:\n\nplus another line at the end.\n");
     EXPECT_EQ(t[1].val(), "Several lines of text,\nwith some \"quotes\" of various 'types',\nand also a blank line:\n\nplus another line at the end.\n\n");
-    out = emitrs<std::string>(t);
+    out = emitrs_yaml<std::string>(t);
     EXPECT_EQ(out, expected);
 }
 
@@ -178,7 +178,7 @@ TEST(block_literal, carriage_return)
     Tree t = parse_in_arena(to_csubstr(yaml));
     EXPECT_EQ(t["with"].val(), "text\n \tlines\n");
     EXPECT_EQ(t["without"].val(), "text\n \tlines\n");
-    auto emitted = emitrs<std::string>(t);
+    auto emitted = emitrs_yaml<std::string>(t);
     #ifdef RYML_DBG
     __c4presc(emitted.data(), emitted.size());
     #endif
diff --git a/test/test_case.hpp b/test/test_case.hpp
index c4781a10d..3a86743f1 100644
--- a/test/test_case.hpp
+++ b/test/test_case.hpp
@@ -99,7 +99,7 @@ void test_check_emit_check(csubstr yaml, CheckFn check_fn)
     }
     auto emit_and_parse = [&](const char* identifier){
         SCOPED_TRACE(identifier);
-        std::string emitted = emitrs<std::string>(t);
+        std::string emitted = emitrs_yaml<std::string>(t);
         #ifdef RYML_DBG
         printf("~~~%s~~~\n%.*s", identifier, (int)emitted.size(), emitted.data());
         #endif
diff --git a/test/test_double_quoted.cpp b/test/test_double_quoted.cpp
index 9820c7fd3..6c3915873 100644
--- a/test/test_double_quoted.cpp
+++ b/test/test_double_quoted.cpp
@@ -407,7 +407,7 @@ TEST(double_quoted, github253)
         root |= MAP;
         root["t"] = "t't\\nt";
         root["t"] |= _WIP_VAL_DQUO;
-        std::string s = emitrs<std::string>(tree);
+        std::string s = emitrs_yaml<std::string>(tree);
         Tree tree2 = parse_in_arena(to_csubstr(s));
         EXPECT_EQ(tree2["t"].val(), tree["t"].val());
     }
@@ -417,7 +417,7 @@ TEST(double_quoted, github253)
         root |= MAP;
         root["t"] = "t't\\nt";
         root["t"] |= _WIP_VAL_SQUO;
-        std::string s = emitrs<std::string>(tree);
+        std::string s = emitrs_yaml<std::string>(tree);
         Tree tree2 = parse_in_arena(to_csubstr(s));
         EXPECT_EQ(tree2["t"].val(), tree["t"].val());
     }
@@ -427,7 +427,7 @@ TEST(double_quoted, github253)
         root |= MAP;
         root["s"] = "t\rt";
         root["s"] |= _WIP_VAL_DQUO;
-        std::string s = emitrs<std::string>(tree);
+        std::string s = emitrs_yaml<std::string>(tree);
         EXPECT_EQ(s, "s: \"t\\rt\"\n");
         Tree tree2 = parse_in_arena(to_csubstr(s));
         EXPECT_EQ(tree2["s"].val(), tree["s"].val());
diff --git a/test/test_emit.cpp b/test/test_emit.cpp
index 50c581ca5..238ceaca2 100644
--- a/test/test_emit.cpp
+++ b/test/test_emit.cpp
@@ -92,37 +92,37 @@ TEST(as_json, basic)
 template<class ...Args>
 void test_emits(Tree const& t, size_t id, std::string const& expected, std::string const& expected_json)
 {
-    EXPECT_EQ(emit2buf([&](substr buf){ return emit(t, id, buf); }), expected);
+    EXPECT_EQ(emit2buf([&](substr buf){ return emit_yaml(t, id, buf); }), expected);
     EXPECT_EQ(emit2buf([&](substr buf){ return emit_json(t, id, buf); }), expected_json);
-    EXPECT_EQ(emit2file([&](FILE *f){ return emit(t, id, f); }), expected);
+    EXPECT_EQ(emit2file([&](FILE *f){ return emit_yaml(t, id, f); }), expected);
     EXPECT_EQ(emit2file([&](FILE *f){ return emit_json(t, id, f); }), expected_json);
-    EXPECT_EQ(emitrs<std::string>(t, id), expected);
+    EXPECT_EQ(emitrs_yaml<std::string>(t, id), expected);
     EXPECT_EQ(emitrs_json<std::string>(t, id), expected_json);
 }
 
 template<class ...Args>
 void test_emits(Tree const& t, std::string const& expected, std::string const& expected_json)
 {
-    EXPECT_EQ(emit2buf([&](substr buf){ return emit(t, buf); }), expected);
+    EXPECT_EQ(emit2buf([&](substr buf){ return emit_yaml(t, buf); }), expected);
     EXPECT_EQ(emit2buf([&](substr buf){ return emit_json(t, buf); }), expected_json);
-    EXPECT_EQ(emit2file([&](FILE *f){ return emit(t, f); }), expected);
+    EXPECT_EQ(emit2file([&](FILE *f){ return emit_yaml(t, f); }), expected);
     EXPECT_EQ(emit2file([&](FILE *f){ return emit_json(t, f); }), expected_json);
     EXPECT_EQ(emit2stream([&](std::ostream& s){ s << t; }), expected);
     EXPECT_EQ(emit2stream([&](std::ostream& s){ s << as_json(t); }), expected_json);
-    EXPECT_EQ(emitrs<std::string>(t), expected);
+    EXPECT_EQ(emitrs_yaml<std::string>(t), expected);
     EXPECT_EQ(emitrs_json<std::string>(t), expected_json);
 }
 
 template<class ...Args>
 void test_emits(ConstNodeRef t, std::string const& expected, std::string const& expected_json)
 {
-    EXPECT_EQ(emit2buf([&](substr buf){ return emit(t, buf); }), expected);
+    EXPECT_EQ(emit2buf([&](substr buf){ return emit_yaml(t, buf); }), expected);
     EXPECT_EQ(emit2buf([&](substr buf){ return emit_json(t, buf); }), expected_json);
-    EXPECT_EQ(emit2file([&](FILE *f){ return emit(t, f); }), expected);
+    EXPECT_EQ(emit2file([&](FILE *f){ return emit_yaml(t, f); }), expected);
     EXPECT_EQ(emit2file([&](FILE *f){ return emit_json(t, f); }), expected_json);
     EXPECT_EQ(emit2stream([&](std::ostream& s){ s << t; }), expected);
     EXPECT_EQ(emit2stream([&](std::ostream& s){ s << as_json(t); }), expected_json);
-    EXPECT_EQ(emitrs<std::string>(t), expected);
+    EXPECT_EQ(emitrs_yaml<std::string>(t), expected);
     EXPECT_EQ(emitrs_json<std::string>(t), expected_json);
 }
 
@@ -379,7 +379,7 @@ TEST(emit, percent_is_quoted)
     ti["%ROOT2"] |= SEQ;
     ti["%ROOT2"][0] = "%VAL";
     ti["%ROOT2"][1] = "%VAL";
-    std::string yaml = emitrs<std::string>(ti);
+    std::string yaml = emitrs_yaml<std::string>(ti);
     test_check_emit_check(to_csubstr(yaml), [](Tree const &t){
         ASSERT_TRUE(t.rootref().is_map());
         ASSERT_TRUE(t.rootref().has_child("%ROOT"));
diff --git a/test/test_group.cpp b/test/test_group.cpp
index d39421298..77ef5fa23 100644
--- a/test/test_group.cpp
+++ b/test/test_group.cpp
@@ -114,7 +114,7 @@ void YmlTestCase::_test_emit_yml_stdout(CaseDataLineEndings *cd)
         return;
     _ensure_parse(cd);
     _ensure_emit(cd);
-    cd->numbytes_stdout = emit(cd->parsed_tree);
+    cd->numbytes_stdout = emit_yaml(cd->parsed_tree);
     EXPECT_EQ(cd->numbytes_stdout, cd->emitted_yml.size());
 }
 
@@ -267,7 +267,7 @@ void YmlTestCase::_test_emit_yml_string(CaseDataLineEndings *cd)
         return;
     _ensure_parse(cd);
     _ensure_emit(cd);
-    auto em = emitrs(cd->parsed_tree, &cd->emit_buf);
+    auto em = emitrs_yaml(cd->parsed_tree, &cd->emit_buf);
     EXPECT_EQ(em.len, cd->emit_buf.size());
     EXPECT_EQ(em.len, cd->numbytes_stdout);
     #ifdef RYML_NFO
@@ -300,11 +300,11 @@ void YmlTestCase::_test_emitrs(CaseDataLineEndings *cd)
     _ensure_parse(cd);
     using vtype = std::vector<char>;
     using stype = std::string;
-    vtype vv, v = emitrs<vtype>(cd->parsed_tree);
-    stype ss, s = emitrs<stype>(cd->parsed_tree);
+    vtype vv, v = emitrs_yaml<vtype>(cd->parsed_tree);
+    stype ss, s = emitrs_yaml<stype>(cd->parsed_tree);
     EXPECT_EQ(to_csubstr(v), to_csubstr(s));
-    csubstr svv = emitrs(cd->parsed_tree, &vv);
-    csubstr sss = emitrs(cd->parsed_tree, &ss);
+    csubstr svv = emitrs_yaml(cd->parsed_tree, &vv);
+    csubstr sss = emitrs_yaml(cd->parsed_tree, &ss);
     EXPECT_EQ(svv, sss);
 }
 
@@ -332,11 +332,11 @@ void YmlTestCase::_test_emitrs_cfile(CaseDataLineEndings *cd)
     if(c->flags & EXPECT_PARSE_ERROR)
         return;
     _ensure_parse(cd);
-    auto s = emitrs<std::string>(cd->parsed_tree);
+    auto s = emitrs_yaml<std::string>(cd->parsed_tree);
     std::string r;
     {
         c4::fs::ScopedTmpFile f;
-        emit(cd->parsed_tree, f.m_file);
+        emit_yaml(cd->parsed_tree, f.m_file);
         fflush(f.m_file);
         r = f.contents<std::string>();
     }
@@ -490,7 +490,7 @@ void YmlTestCase::_test_recreate_from_ref(CaseDataLineEndings *cd)
     if(cd->parsed_tree.empty())
         parse_in_place(c->fileline, cd->src, &cd->parsed_tree);
     if(cd->emit_buf.empty())
-        cd->emitted_yml = emitrs(cd->parsed_tree, &cd->emit_buf);
+        cd->emitted_yml = emitrs_yaml(cd->parsed_tree, &cd->emit_buf);
     {
         SCOPED_TRACE("recreating a new tree from the ref tree");
         cd->recreated.reserve(cd->parsed_tree.size());
diff --git a/test/test_group.hpp b/test/test_group.hpp
index e7ffa47dd..f661ec9b5 100644
--- a/test/test_group.hpp
+++ b/test/test_group.hpp
@@ -85,7 +85,7 @@ struct YmlTestCase : public ::testing::TestWithParam<csubstr>
         _ensure_parse(cd);
         if(cd->emit_buf.empty())
         {
-            cd->emitted_yml = emitrs(cd->parsed_tree, &cd->emit_buf);
+            cd->emitted_yml = emitrs_yaml(cd->parsed_tree, &cd->emit_buf);
             ASSERT_EQ(cd->emitted_yml.size(), cd->emit_buf.size());
             if(cd->emitted_yml.size())
             {
diff --git a/test/test_json.cpp b/test/test_json.cpp
index d836e5170..ef2b4701d 100644
--- a/test/test_json.cpp
+++ b/test/test_json.cpp
@@ -213,7 +213,7 @@ broken_value: "0.30.2"
     emitrs_json(t, &out);
     EXPECT_EQ(out, R"({"string_value": "string","number_value": "9001","broken_value": "0.30.2"})");
     out.clear();
-    emitrs(t, &out);
+    emitrs_yaml(t, &out);
     EXPECT_EQ(out, R"(string_value: 'string'
 number_value: '9001'
 broken_value: '0.30.2'
diff --git a/test/test_merge.cpp b/test/test_merge.cpp
index 85ec74d32..873412115 100644
--- a/test/test_merge.cpp
+++ b/test/test_merge.cpp
@@ -42,8 +42,8 @@ void test_merge(std::initializer_list<csubstr> li, csubstr expected)
         merged.merge_with(&loaded);
     }
 
-    auto buf_result = emitrs<std::string>(merged);
-    auto buf_expected = emitrs<std::string>(ref);
+    auto buf_result = emitrs_yaml<std::string>(merged);
+    auto buf_expected = emitrs_yaml<std::string>(ref);
 
     EXPECT_EQ(buf_result, buf_expected);
 }
diff --git a/test/test_noderef.cpp b/test/test_noderef.cpp
index abeb3cee5..7f5b4aa41 100644
--- a/test/test_noderef.cpp
+++ b/test/test_noderef.cpp
@@ -101,7 +101,7 @@ TEST(NodeRef, general)
     EXPECT_EQ(root["b"]["key"].val(), "val");
 
 
-    emit(t);
+    emit_yaml(t);
 
     EXPECT_TRUE(root.type().is_map());
     EXPECT_TRUE(root["a"].type().is_keyval());
@@ -140,7 +140,7 @@ TEST(NodeRef, general)
 
     root["b"]["seq"][2].set_val_serialized(22);
 
-    emit(t);
+    emit_yaml(t);
 
     EXPECT_TRUE(root["b"]["aaa"].type().is_keyval());
     EXPECT_EQ(root["b"]["aaa"].key_tag(), "!!str");
@@ -301,9 +301,9 @@ TEST(NodeRef, move_in_same_parent)
     EXPECT_TRUE(m.is_map());
     EXPECT_EQ(s.num_children(), vec2.size());
     EXPECT_EQ(m.num_children(), map2.size());
-    //printf("fonix"); print_tree(t); emit(r);
+    //printf("fonix"); print_tree(t); emit_yaml(r);
     r[0].move(r[1]);
-    //printf("fonix"); print_tree(t); emit(r);
+    //printf("fonix"); print_tree(t); emit_yaml(r);
     EXPECT_EQ(r[0].get(), m.get());
     EXPECT_EQ(r[0].num_children(), map2.size());
     EXPECT_EQ(r[1].get(), s.get());
@@ -326,11 +326,11 @@ TEST(NodeRef, move_to_other_parent)
 
     NodeData *elm2 = r[2].get();
     EXPECT_EQ(r[2].val(), "elm2");
-    //printf("fonix"); print_tree(t); emit(r);
+    //printf("fonix"); print_tree(t); emit_yaml(r);
     r[2].move(r[0], r[0][0]);
     EXPECT_EQ(r[0][1].get(), elm2);
     EXPECT_EQ(r[0][1].val(), "elm2");
-    //printf("fonix"); print_tree(t); emit(r);
+    //printf("fonix"); print_tree(t); emit_yaml(r);
 }
 
 TEST(NodeRef, duplicate)
diff --git a/test/test_number.cpp b/test/test_number.cpp
index a6c1dc193..41c388ae6 100644
--- a/test/test_number.cpp
+++ b/test/test_number.cpp
@@ -41,7 +41,7 @@ void test_ints()
         EXPECT_EQ(out, val);
     }
     {
-        std::string emitted = emitrs<std::string>(t);
+        std::string emitted = emitrs_yaml<std::string>(t);
         Tree parsed = parse_in_place(to_substr(emitted));
         ASSERT_EQ(parsed["dec"].num_children(), values.size());
         ASSERT_EQ(parsed["hex"].num_children(), values.size());
diff --git a/test/test_seq_of_map.cpp b/test/test_seq_of_map.cpp
index ec1bacf04..90bbcbd79 100644
--- a/test/test_seq_of_map.cpp
+++ b/test/test_seq_of_map.cpp
@@ -20,7 +20,7 @@ TEST(seq_of_map, with_anchors)
   a4: v4
 )";
         Tree t = parse_in_arena(yaml);
-        EXPECT_EQ(emitrs<std::string>(t), yaml);
+        EXPECT_EQ(emitrs_yaml<std::string>(t), yaml);
         ASSERT_EQ(t.rootref().num_children(), 3u);
         ASSERT_EQ(t[2].has_val_anchor(), true);
         ASSERT_EQ(t[2].val_anchor(), "seq");
@@ -36,7 +36,7 @@ TEST(seq_of_map, with_anchors)
   *a3: w3
 )";
         Tree t = parse_in_arena(yaml);
-        EXPECT_EQ(emitrs<std::string>(t), yaml);
+        EXPECT_EQ(emitrs_yaml<std::string>(t), yaml);
     }
 }
 
@@ -58,7 +58,7 @@ TEST(seq_of_map, with_tags)
   !foo a3: v3
 )";
         Tree t = parse_in_arena(yaml);
-        EXPECT_EQ(emitrs<std::string>(t), yaml);
+        EXPECT_EQ(emitrs_yaml<std::string>(t), yaml);
     }
     {
         // but this case may fail because the indentation
@@ -74,7 +74,7 @@ TEST(seq_of_map, with_tags)
   !foo a3: v3
 )";
         Tree t = parse_in_arena(yaml);
-        EXPECT_EQ(emitrs<std::string>(t), yaml);
+        EXPECT_EQ(emitrs_yaml<std::string>(t), yaml);
     }
 }
 
diff --git a/test/test_serialize.cpp b/test/test_serialize.cpp
index 1a10420bc..979de7c79 100644
--- a/test/test_serialize.cpp
+++ b/test/test_serialize.cpp
@@ -79,7 +79,7 @@ TEST(serialize, type_as_str)
     EXPECT_EQ(v4in.w, v4out.w);
 
     char buf[256];
-    c4::csubstr ret = c4::yml::emit(t, buf);
+    c4::csubstr ret = c4::yml::emit_yaml(t, buf);
     EXPECT_EQ(ret, R"(v2: '(10,11)'
 v3: '(100,101,102)'
 v4: '(1000,1001,1002,1003)'
@@ -104,7 +104,7 @@ void do_test_serialize(Args&& ...args)
 
     n << s;
     //print_tree(t);
-    emit(t);
+    emit_yaml(t);
     c4::yml::check_invariants(t);
     n >> out;
     EXPECT_EQ(s, out);
@@ -441,7 +441,7 @@ TEST(serialize, anchor_and_ref_round_trip)
 
     Tree t = parse_in_arena(yaml);
     std::string cmpbuf;
-    emitrs(t, &cmpbuf);
+    emitrs_yaml(t, &cmpbuf);
     EXPECT_EQ(cmpbuf, yaml);
 }
 
@@ -475,7 +475,7 @@ TEST(serialize, create_anchor_ref_trip)
     tree.set_val_ref(elem0_id, "id001");
 
     std::string cmpbuf;
-    emitrs(tree, &cmpbuf);
+    emitrs_yaml(tree, &cmpbuf);
     EXPECT_EQ(cmpbuf, expected_yaml);
 }
 
diff --git a/test/test_simple_anchor.cpp b/test/test_simple_anchor.cpp
index e048fe29a..0ee4a629f 100644
--- a/test/test_simple_anchor.cpp
+++ b/test/test_simple_anchor.cpp
@@ -68,14 +68,14 @@ TEST(anchors, no_ambiguity_when_key_scalars_begin_with_star)
     EXPECT_EQ(t[1].key_ref(), "foo");
     EXPECT_EQ(t[2].key(), "*foo");
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(foo: &foo 1
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(foo: &foo 1
 *foo: 2
 '*foo': 3
 )");
 
     t.resolve();
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(foo: 1
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(foo: 1
 1: 2
 '*foo': 3
 )");
@@ -95,14 +95,14 @@ TEST(anchors, no_ambiguity_when_val_scalars_begin_with_star)
     EXPECT_EQ(t["ref"].val(), "*foo");
     EXPECT_EQ(t["quo"].val(), "*foo");
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(foo: &foo 1
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(foo: &foo 1
 ref: *foo
 quo: '*foo'
 )");
 
     t.resolve();
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(foo: 1
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(foo: 1
 ref: 1
 quo: '*foo'
 )");
@@ -126,7 +126,7 @@ TEST(anchors, no_ambiguity_with_inheritance)
     EXPECT_EQ(t["bar"]["<<"].key_ref(), "<<");
     EXPECT_EQ(t["bar"]["<<"].val_ref(), "foo");
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(foo: &foo
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(foo: &foo
   a: 1
   b: 2
 bar:
@@ -137,7 +137,7 @@ TEST(anchors, no_ambiguity_with_inheritance)
   '<<': hehe
 )");
     t.resolve();
-    EXPECT_EQ(emitrs<std::string>(t), R"(foo:
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(foo:
   a: 1
   b: 2
 bar:
@@ -166,7 +166,7 @@ TEST(anchors, programatic_key_ref)
     ch = r.append_child();
     ch.set_key_ref("vanchor");
     ch.set_val("7");
-    EXPECT_EQ(emitrs<std::string>(t), R"(&kanchor kanchor: 2
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(&kanchor kanchor: 2
 vanchor: &vanchor 3
 '*kanchor': 4
 '*vanchor': 5
@@ -174,7 +174,7 @@ vanchor: &vanchor 3
 *vanchor: 7
 )");
     t.resolve();
-    EXPECT_EQ(emitrs<std::string>(t), R"(kanchor: 2
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(kanchor: 2
 vanchor: 3
 '*kanchor': 4
 '*vanchor': 5
@@ -196,13 +196,13 @@ TEST(anchors, programatic_val_ref)
     t["kref"].set_val_ref("kanchor");
     t["vref"].set_val_ref("vanchor");
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(&kanchor kanchor: 2
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(&kanchor kanchor: 2
 vanchor: &vanchor 3
 kref: *kanchor
 vref: *vanchor
 )");
     t.resolve();
-    EXPECT_EQ(emitrs<std::string>(t), R"(kanchor: 2
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(kanchor: 2
 vanchor: 3
 kref: kanchor
 vref: 3
@@ -224,7 +224,7 @@ TEST(anchors, programatic_inheritance)
 
     t["notref"]["<<"] = "*orig";
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(orig: &orig
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(orig: &orig
   foo: bar
   baz: bat
 copy:
@@ -236,7 +236,7 @@ TEST(anchors, programatic_inheritance)
   '<<': '*orig'
 )");
     t.resolve();
-    EXPECT_EQ(emitrs<std::string>(t), R"(orig:
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(orig:
   foo: bar
   baz: bat
 copy:
@@ -270,7 +270,7 @@ TEST(anchors, programatic_multiple_inheritance)
     ref2.set_val_ref("orig2");
     ref3.set_val_ref("orig3");
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(orig1: &orig1
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(orig1: &orig1
   foo: bar
 orig2: &orig2
   baz: bat
@@ -283,7 +283,7 @@ orig3: &orig3
     - *orig3
 )");
     t.resolve();
-    EXPECT_EQ(emitrs<std::string>(t), R"(orig1:
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(orig1:
   foo: bar
 orig2:
   baz: bat
@@ -304,7 +304,7 @@ TEST(anchors, set_anchor_leading_ampersand_is_optional)
     t["with"].set_key_anchor("&with");
     EXPECT_EQ(t["without"].key_anchor(), "without");
     EXPECT_EQ(t["with"].key_anchor(), "with");
-    EXPECT_EQ(emitrs<std::string>(t), R"(&without without: 0
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(&without without: 0
 &with with: 1
 )");
 
@@ -312,7 +312,7 @@ TEST(anchors, set_anchor_leading_ampersand_is_optional)
     t["with"].set_val_anchor("&with");
     EXPECT_EQ(t["without"].val_anchor(), "without");
     EXPECT_EQ(t["with"].val_anchor(), "with");
-    EXPECT_EQ(emitrs<std::string>(t), R"(&without without: &without 0
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(&without without: &without 0
 &with with: &with 1
 )");
 }
@@ -323,7 +323,7 @@ TEST(anchors, set_ref_leading_star_is_optional)
 
     t["*without"] = "0";
     t["*with"] = "1";
-    EXPECT_EQ(emitrs<std::string>(t), R"('*without': 0
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"('*without': 0
 '*with': 1
 )");
 
@@ -331,7 +331,7 @@ TEST(anchors, set_ref_leading_star_is_optional)
     t["*with"].set_key_ref("*with");
     EXPECT_EQ(t["*without"].key_ref(), "without");
     EXPECT_EQ(t["*with"].key_ref(), "with");
-    EXPECT_EQ(emitrs<std::string>(t), R"(*without: 0
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(*without: 0
 *with: 1
 )");
 
@@ -339,7 +339,7 @@ TEST(anchors, set_ref_leading_star_is_optional)
     t["*with"].set_val_ref("*with");
     EXPECT_EQ(t["*without"].val_ref(), "without");
     EXPECT_EQ(t["*with"].val_ref(), "with");
-    EXPECT_EQ(emitrs<std::string>(t), R"(*without: *without
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(*without: *without
 *with: *with
 )");
 }
@@ -362,7 +362,7 @@ TEST(anchors, set_key_ref_also_sets_the_key_when_none_exists)
     EXPECT_EQ(with.key(), "*with");
     EXPECT_EQ(without.key_ref(), "without");
     EXPECT_EQ(with.key_ref(), "with");
-    EXPECT_EQ(emitrs<std::string>(t), R"(*without: 0
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(*without: 0
 *with: 1
 )");
 }
@@ -385,7 +385,7 @@ TEST(anchors, set_val_ref_also_sets_the_val_when_none_exists)
     EXPECT_EQ(with.val(), "*with");
     EXPECT_EQ(without.val_ref(), "without");
     EXPECT_EQ(with.val_ref(), "with");
-    EXPECT_EQ(emitrs<std::string>(t), R"(without: *without
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(without: *without
 with: *with
 )");
 }
@@ -399,7 +399,7 @@ TEST(anchors, set_key_ref_replaces_existing_key)
     EXPECT_FALSE(root.has_child("*foo"));
     EXPECT_FALSE(root.has_child("*notfoo"));
     EXPECT_TRUE(root.has_child("notfoo"));
-    EXPECT_EQ(emitrs<std::string>(t), "*notfoo: bar\n");
+    EXPECT_EQ(emitrs_yaml<std::string>(t), "*notfoo: bar\n");
 }
 
 TEST(anchors, set_val_ref_replaces_existing_key)
@@ -410,7 +410,7 @@ TEST(anchors, set_val_ref_replaces_existing_key)
     EXPECT_EQ(root["foo"].val(), "notbar");
     root["foo"].set_val_ref("*notfoo");
     EXPECT_EQ(root["foo"].val(), "*notfoo");
-    EXPECT_EQ(emitrs<std::string>(t), "foo: *notfoo\n");
+    EXPECT_EQ(emitrs_yaml<std::string>(t), "foo: *notfoo\n");
 }
 
 
@@ -431,7 +431,7 @@ foo: key
 )");
     #endif
     // so we get this instead:
-    EXPECT_EQ(emitrs<std::string>(t), R"(key: value
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(key: value
 foo:
   value: 
 )");
@@ -577,13 +577,13 @@ TEST(simple_anchor, resolve_works_on_keyrefvalref)
     EXPECT_EQ(t["*b"].is_val_ref(), true);
     EXPECT_EQ(t["*b"].key_ref(), "b");
     EXPECT_EQ(t["*b"].val_ref(), "a");
-    EXPECT_EQ(emitrs<std::string>(t), R"(&a a: &b b
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(&a a: &b b
 *b: *a
 )");
     t.resolve();
     EXPECT_EQ(t["a"].val(), "b");
     EXPECT_EQ(t["b"].val(), "a");
-    EXPECT_EQ(emitrs<std::string>(t), R"(a: b
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(a: b
 b: a
 )");
 }
diff --git a/test/test_simple_doc.cpp b/test/test_simple_doc.cpp
index a27a56586..9e47c6b1e 100644
--- a/test/test_simple_doc.cpp
+++ b/test/test_simple_doc.cpp
@@ -22,7 +22,7 @@ TEST(simple_doc, issue_251)
         root["test"] = "...";
         root["test"] |= VALQUO;
 
-        std::string s = emitrs<std::string>(tree);
+        std::string s = emitrs_yaml<std::string>(tree);
         test_check_emit_check(to_csubstr(s), [](Tree const &t){
             EXPECT_EQ(t["test"].val(), "...");
         });
diff --git a/test/test_simple_set.cpp b/test/test_simple_set.cpp
index 50bf3be2c..f209c79c7 100644
--- a/test/test_simple_set.cpp
+++ b/test/test_simple_set.cpp
@@ -17,7 +17,7 @@ TEST(simple_set, emit)
 cc: 
 )";
     Tree t = parse_in_arena(yaml);
-    auto s = emitrs<std::string>(t);
+    auto s = emitrs_yaml<std::string>(t);
     EXPECT_EQ(expected, s);
 }
 
@@ -35,7 +35,7 @@ TEST(simple_set, emit_doc)
 cc: 
 )";
     Tree t = parse_in_arena(yaml);
-    auto s = emitrs<std::string>(t);
+    auto s = emitrs_yaml<std::string>(t);
     EXPECT_EQ(expected, s);
 }
 
diff --git a/test/test_style.cpp b/test/test_style.cpp
index a972820ce..5b46d075b 100644
--- a/test/test_style.cpp
+++ b/test/test_style.cpp
@@ -16,7 +16,7 @@ namespace yml {
 
 std::string emit2str(Tree const& t)
 {
-    return emitrs<std::string>(t);
+    return emitrs_yaml<std::string>(t);
 }
 
 
@@ -67,27 +67,27 @@ void check_same_emit(Tree const& expected)
     #endif
 
     std::string ws1, ws2, ws3, ws4;
-    emitrs(expected, &ws1);
+    emitrs_yaml(expected, &ws1);
     {
         SCOPED_TRACE("actual1");
         Tree actual1 = parse_in_arena(to_csubstr(ws1));
         _showtrees(1);
         test_compare(actual1, expected);
-        emitrs(actual1, &ws2);
+        emitrs_yaml(actual1, &ws2);
     }
     {
         SCOPED_TRACE("actual2");
         Tree actual2 = parse_in_arena(to_csubstr(ws2));
         _showtrees(2);
         test_compare(actual2, expected);
-        emitrs(actual2, &ws3);
+        emitrs_yaml(actual2, &ws3);
     }
     {
         SCOPED_TRACE("actual3");
         Tree actual3 = parse_in_arena(to_csubstr(ws3));
         _showtrees(3);
         test_compare(actual3, expected);
-        emitrs(actual3, &ws4);
+        emitrs_yaml(actual3, &ws4);
     }
     {
         SCOPED_TRACE("actual4");
diff --git a/test/test_suite.cpp b/test/test_suite.cpp
index 566ff4d63..22dabf8c4 100644
--- a/test/test_suite.cpp
+++ b/test/test_suite.cpp
@@ -220,7 +220,7 @@ struct ProcLevel
             _nfo_logf("level[{}] not parsed. parse!", level);
             parse();
         }
-        emitrs(tree, &emitted);
+        emitrs_yaml(tree, &emitted);
         csubstr ss = to_csubstr(emitted);
         if(ss.ends_with("\n...\n"))
             emitted.resize(emitted.size() - 4);
diff --git a/test/test_tag_property.cpp b/test/test_tag_property.cpp
index a240c46b6..e56fef994 100644
--- a/test/test_tag_property.cpp
+++ b/test/test_tag_property.cpp
@@ -21,7 +21,7 @@ TEST(tag_directives, basic)
     char buf_[100];
     EXPECT_EQ(t.resolve_tag_sub(buf_, "!m!light", 1u), csubstr("<!my-light>"));
     EXPECT_EQ(t.resolve_tag_sub(buf_, "!m!light", 2u), csubstr("<!meta-light>"));
-    EXPECT_EQ(emitrs<std::string>(t), std::string(R"(%TAG !m! !my-
+    EXPECT_EQ(emitrs_yaml<std::string>(t), std::string(R"(%TAG !m! !my-
 --- !m!light fluorescent
 ...
 %TAG !m! !meta-
@@ -46,7 +46,7 @@ TEST(tag_directives, accepts_comment)
     char buf_[100];
     EXPECT_EQ(t.resolve_tag_sub(buf_, "!m!light", 1u), csubstr("<!my-light>"));
     EXPECT_EQ(t.resolve_tag_sub(buf_, "!m!light", 2u), csubstr("<!meta-light>"));
-    EXPECT_EQ(emitrs<std::string>(t), std::string(R"(%TAG !m! !my-
+    EXPECT_EQ(emitrs_yaml<std::string>(t), std::string(R"(%TAG !m! !my-
 --- !m!light fluorescent
 ...
 %TAG !m! !meta-
@@ -71,7 +71,7 @@ TEST(tag_directives, accepts_multiple_spaces)
     char buf_[100];
     EXPECT_EQ(t.resolve_tag_sub(buf_, "!m!light", 1u), csubstr("<!my-light>"));
     EXPECT_EQ(t.resolve_tag_sub(buf_, "!m!light", 2u), csubstr("<!meta-light>"));
-    EXPECT_EQ(emitrs<std::string>(t), std::string(R"(%TAG !m! !my-
+    EXPECT_EQ(emitrs_yaml<std::string>(t), std::string(R"(%TAG !m! !my-
 --- !m!light fluorescent
 ...
 %TAG !m! !meta-
@@ -118,7 +118,7 @@ TEST(tag_directives, resolve_tags)
     t.resolve_tags();
     EXPECT_EQ(t.docref(0)[0].key_tag(), "<!my-light>");
     EXPECT_EQ(t.docref(0)[0].val_tag(), "<!my-light>");
-    EXPECT_EQ(emitrs<std::string>(t), std::string(R"(%TAG !m! !my-
+    EXPECT_EQ(emitrs_yaml<std::string>(t), std::string(R"(%TAG !m! !my-
 ---
 !<!my-light> fluorescent: !<!my-light> bulb
 ...
@@ -299,7 +299,7 @@ TEST(tags, parsing)
     EXPECT_EQ(t[0]["<!key> key4"].val(), csubstr("<!val> val4"));
     EXPECT_EQ(t[2][5].val_tag(), csubstr("!!str"));
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(!!seq
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(!!seq
 - !!map
   !key key1: !val val1
   !<!key> key2: !<!val> val2
@@ -477,7 +477,7 @@ TEST(tags, setting_user_tags_do_not_require_leading_mark)
     EXPECT_EQ(t.val_tag(keyseq), "valtag");
     EXPECT_EQ(t.val_tag(val),    "valtag2");
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(key: val
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(key: val
 keymap: {}
 !keytag keyseq: !valtag
   - !valtag2 val
@@ -491,7 +491,7 @@ keymap: {}
     EXPECT_EQ(t.val_tag(keyseq), "!valtag");
     EXPECT_EQ(t.val_tag(val),    "!valtag2");
 
-    EXPECT_EQ(emitrs<std::string>(t), R"(key: val
+    EXPECT_EQ(emitrs_yaml<std::string>(t), R"(key: val
 keymap: {}
 !keytag keyseq: !valtag
   - !valtag2 val
diff --git a/test/test_tree.cpp b/test/test_tree.cpp
index c7e2dddc4..7b8b76e8b 100644
--- a/test/test_tree.cpp
+++ b/test/test_tree.cpp
@@ -958,7 +958,7 @@ far: a long long way to run
 )");
     Tree copy = tree;
     EXPECT_EQ(copy.size(), tree.size());
-    EXPECT_EQ(emitrs<std::string>(copy), R"(&keyanchor key: val
+    EXPECT_EQ(emitrs_yaml<std::string>(copy), R"(&keyanchor key: val
 key2: &valanchor val2
 keyref: *keyanchor
 *valanchor: was val anchor
@@ -972,7 +972,7 @@ far: a long long way to run
     Tree copy2 = copy;
     EXPECT_EQ(copy.size(), tree.size());
     copy2.resolve();
-    EXPECT_EQ(emitrs<std::string>(copy2), R"(key: val
+    EXPECT_EQ(emitrs_yaml<std::string>(copy2), R"(key: val
 key2: val2
 keyref: key
 val2: was val anchor
@@ -3215,7 +3215,7 @@ TEST(change_type, from_val)
     t[1].change_type(MAP);
     t[2].change_type(SEQ);
     Tree expected = parse_in_arena("[val0, {}, []]");
-    EXPECT_EQ(emitrs<std::string>(t), emitrs<std::string>(expected));
+    EXPECT_EQ(emitrs_yaml<std::string>(t), emitrs_yaml<std::string>(expected));
 }
 TEST(change_type, from_keyval)
 {
@@ -3224,7 +3224,7 @@ TEST(change_type, from_keyval)
     t[1].change_type(MAP);
     t[2].change_type(SEQ);
     Tree expected = parse_in_arena("{keyval0: val0, keyval1: {}, keyval2: []}");
-    EXPECT_EQ(emitrs<std::string>(t), emitrs<std::string>(expected));
+    EXPECT_EQ(emitrs_yaml<std::string>(t), emitrs_yaml<std::string>(expected));
 }
 
 TEST(change_type, from_map)
@@ -3234,7 +3234,7 @@ TEST(change_type, from_map)
     t[1].change_type(MAP);
     t[2].change_type(SEQ);
     Tree expected = parse_in_arena("[ , {map1: {map1key0: a, map1key1: b}}, []]");
-    EXPECT_EQ(emitrs<std::string>(t), emitrs<std::string>(expected));
+    EXPECT_EQ(emitrs_yaml<std::string>(t), emitrs_yaml<std::string>(expected));
 }
 TEST(change_type, from_keymap)
 {
@@ -3243,7 +3243,7 @@ TEST(change_type, from_keymap)
     t[1].change_type(MAP);
     t[2].change_type(SEQ);
     Tree expected = parse_in_arena("{map0: , map1: {map1: {map1key0: a, map1key1: b}}, map2: []}");
-    EXPECT_EQ(emitrs<std::string>(t), emitrs<std::string>(expected));
+    EXPECT_EQ(emitrs_yaml<std::string>(t), emitrs_yaml<std::string>(expected));
 }
 
 TEST(change_type, from_seq)
@@ -3253,7 +3253,7 @@ TEST(change_type, from_seq)
     t[1].change_type(MAP);
     t[2].change_type(SEQ);
     Tree expected = parse_in_arena("[ , {}, [seq20, seq21]]");
-    EXPECT_EQ(emitrs<std::string>(t), emitrs<std::string>(expected));
+    EXPECT_EQ(emitrs_yaml<std::string>(t), emitrs_yaml<std::string>(expected));
 }
 TEST(change_type, from_keyseq)
 {
@@ -3262,7 +3262,7 @@ TEST(change_type, from_keyseq)
     t[1].change_type(MAP);
     t[2].change_type(SEQ);
     Tree expected = parse_in_arena("{map0: , map1: {}, map2: [seq20, seq21]}");
-    EXPECT_EQ(emitrs<std::string>(t), emitrs<std::string>(expected));
+    EXPECT_EQ(emitrs_yaml<std::string>(t), emitrs_yaml<std::string>(expected));
 }
 
 
@@ -3469,7 +3469,7 @@ TEST(Tree, lookup_path_or_modify)
         EXPECT_EQ(t["newmap"]["newseq1"][2][2][2].val(), "trigger");
         EXPECT_EQ(t["newmap"]["newseq1"][2][2][3].val(), "happy");
 
-        EXPECT_EQ(emitrs<std::string>(t), R"(newmap:
+        EXPECT_EQ(emitrs_yaml<std::string>(t), R"(newmap:
   newseq:
     - newmap:
         newseq: