On 11/07/2022 09:36, David Boss wrote:
I generally run in Fundamental mode. Since ASCII is really only a 7-bit
code, I use the high bit to indicate italics.
...
I want to be able to copy an emacs buffer, with some characters having
italic mode set, and paste that into an email compose buffer, and have
the italics set in the email buffer; this should work, but it doesn't, who
knows, who cares, why not. But if I copy/paste a .odt file, with
italicized characters, the italics show up as intended, in the email
buffer.
You did not provided any detail which email client and which OS you are
using. I do not know how it is implemented on Windows, but on Linux
applications declares several MIME types for selection: UTF8_STRING,
text/html, etc. Applications that can insert formatted text use HTML,
pure text application query plain text. To inspect available types the
following command may be used:
xclip -target TARGETS -out -selection CLIPBOARD
AFAIK emacs can not provide several types for selection content and
xclip does not have such feature as well. When you are sure that namely
formatted text is required, you can try to feed markup to xclip -target
text/html.
I do not think that Org is appropriate tool for your purpose, escaping
is tricky, zero-width spaces when used in such case should be removed
from the target document. Constructing org-element AST directly may be
more reliable.
Within Emacs yank-handler text property may help to copy text from your
specific encoding to other buffers.