help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What happens with text properties in batch mode?


From: Marcin Borkowski
Subject: Re: What happens with text properties in batch mode?
Date: Sat, 08 Dec 2018 20:28:26 +0100
User-agent: mu4e 1.1.0; emacs 27.0.50

On 2018-12-07, at 09:42, tomas@tuxteam.de wrote:

> On Fri, Dec 07, 2018 at 08:56:23AM +0100, Marcin Borkowski wrote:
>> Hi all,
>> 
>> it seems that when I `princ' something with text properties (e.g.,
>> colored faces) in batch mode, the colors disappear.
>
> From a quick test here (which may be flawed, mind you), I can confirm
> that princ removes the properties from strings.
>
>> Is it documented anywhere?  Can I disable this behavior?
>
> I don't know about that. A cursory look at "print.c", and there, the C
> functions `print' and `print_object' suggest that yes, it's intentional,
> and it's pretty deeply rooted.

OK, thanks.

>> I found this: https://github.com/Lindydancer/e2ansi, and its existence
>> suggests that outputting colored stuff (using ANSI codes) is
>> non-trivial.  Am I right?
>
> I think this is only relevant if you are trying to colorize the output
> to an ANSI terminal (or more probably to an ANSI terminal emulator, like
> an Xterm or the Linux console, unless you're working at a computer
> museum, these days). Probably not relevant in your case, since `princ'
> outputs most of the time to some buffer-like thingy, but can be trained
> to do almost everything...
>
> What are you trying to achieve?

Well, quite relevant - if I run Emacs in batch mode, princ and friends
output to stdout.

Thanks,

-- 
Marcin Borkowski
http://mbork.pl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]