Subject: bug#37814: [PATCH] Add an option to preserve ANSI sequences

From: Pablo Barbachano <[email-masked]>
Date: Fri, 01 Nov 2019 21:25:28 +0100

Hi,

> Could you please elaborate on the use case(s) that could benefit from
> this change?

My use case is when running shell code in org-babel and capturing the resulting output. I can get it to interpret the ANSI sequences, but when I save the org buffer, the ANSI information would get lost.

This is actually what I'm trying to do: https://emacs.stackexchange.com/questions/35364/how-do-i-attach-a-custom-function-to-process-org-mode-babel-shell-output

> Also, using overlays would mean that copying the text elsewhere will
> reveal the SGR sequences, is that intended?  If not, perhaps using
> text properties would be better?

So far I haven't had a need for that. Also, since the rest of the code uses overlays, would it be OK to mix text properties and overlays?

> Did you consider using some non-trivial invisibility spec instead of
> just t?  It's hard to say if this would make sense without knowing the
> use cases you had in mind.

I didn't think of it. But I can see now that a keyword argument would allow for different behaviors:

- nil - delete the sequences (default)
- 'invisible - invisible overlay over the sequences
- 'keep - don't delete the sequences

I will rework the patch to allow that.

> The commit log message is not formatted according to our conventions;
> see CONTRIBUTE in the Emacs sources for the details.

Thanks. I will look at it.

> Finally, these changes are too large for us to accept them without a
> copyright assignment.  Would you like to start the legal paperwork to
> that end?  If so, I will send you the form to fill.

Yes, please, send me the form.

> Thanks again for your interest in Emacs.

Thank you for the fast review!

--
Pablo