3

Emacs enriched-text stores test properties like font and colours that can be quite useful (colours in build logs, RTF-like documents, etc...)

Is there any other applications capable of rendering Emacs enriched-text files. For instance is it possible to get Firefox display them?

1 Answer 1

4

The etc/enriched.txt file points out that the basic file format is the text/enriched MIME format described by RFC1896:

https://www.ietf.org/rfc/rfc1896.txt

Enriched-mode documents are saved in an extended version of a format called text/enriched, which is defined as part of the MIME standard. This means that your documents are transportable (even through email) to many other systems. In the future other file formats may be supported as well.

However:

Since Emacs adds some non-standard features to the format (colors and read-only regions), not all systems will be able to recreate all of the features of your document, but they will get as close as possible.

So if other things support text/enriched generally, I would make that the focus of your searches. I don't know whether anything does, but as a standard and SGML-like MIME format with a simple conversion to SGML/HTML, I'd rather expect that things would do so.

The two appendices are noteworthy in that regard:

  • Appendix A -- A Simple enriched-to-plain Translator in C

One of the major goals in the design of the text/enriched subtype of the text Content-Type is to make formatted text so simple that even text-only mailers will implement enriched-to-plain-text translators, thus increasing the likelihood that multifont text will become "safe" to use very widely. To demonstrate this simplicity, what follows is a simple C program that converts text/enriched input into plain text output. Note that the local newline convention (the single character represented by "\n") is assumed by this program, but that special CRLF handling might be necessary on some systems.

  • Appendix B -- A Simple enriched-to-HTML Translator in C

It is fully expected that other text formatting standards like HTML and SGML will supplant text/enriched in Internet mail. It is also likely that as this happens, recipients of text/enriched mail will wish to view such mail with an HTML viewer. To this end, the following is a simple example of a C program to convert text/enriched to HTML. Since the current version of HTML at the time of this document's publication is HTML 2.0 defined in [RFC-1866], this program converts to that standard. There are several text/enriched commands that have no HTML 2.0 equivalent. In those cases, this program simply puts those commands into processing instructions; that is, surrounded by "<?" and ">". As in Appendix A, the local newline convention (the single character represented by "\n") is assumed by this program, but special CRLF handling might be necessary on some systems.

1
  • Good answer. Thx.
    – Drew
    Commented Jun 21, 2022 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.