From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: What happens with text properties in batch mode? Date: Fri, 7 Dec 2018 09:42:06 +0100 Message-ID: <20181207084206.GA27268@tuxteam.de> References: <87h8fplqhk.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" X-Trace: blaine.gmane.org 1544172040 22832 195.159.176.226 (7 Dec 2018 08:40:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 7 Dec 2018 08:40:40 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 07 09:40:36 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVBgZ-0005nr-ML for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Dec 2018 09:40:35 +0100 Original-Received: from localhost ([::1]:44762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVBig-0002xy-0n for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Dec 2018 03:42:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVBiF-0002xr-L0 for help-gnu-emacs@gnu.org; Fri, 07 Dec 2018 03:42:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVBiA-0001pY-Kt for help-gnu-emacs@gnu.org; Fri, 07 Dec 2018 03:42:19 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:43549) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gVBiA-0001kI-92 for help-gnu-emacs@gnu.org; Fri, 07 Dec 2018 03:42:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=wbNgrpvJ2RpU1P97DNqI8ZGszjLs80x7B6xrOJAJIOI=; b=S8yGD9XF/kcchIjRsZoCN6Hx1kDkU2eb4qA0YfvpsLfXAD55UjvGkJXmkE1DKH6OWUnidIK55gglGlPUCD4ula5tUg8R3tU0Eg9nJReIeDsU/CTiH+6Y1Ib3V+e6zvhBGDNQWE/dgiHtu/dgKR51LapE+3TPyryIZHRaHl4JPGSHT1F3WUVv79SJnAfqmxc01WvHnyQLfHEOQ5zYNSs2tQMwGgeh5BqpYzB8AYOHmYxNBxamNnkPyglZeznVanUrBdUAWHockOeSWegdEn51QsAIA023jRYG/HBzOuiI2rOQUtEHXuQssfviRnPpWtX6l8gjGOA7hzrZGhR3J/A5XA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1gVBi2-0007JV-9V for help-gnu-emacs@gnu.org; Fri, 07 Dec 2018 09:42:06 +0100 Content-Disposition: inline In-Reply-To: <87h8fplqhk.fsf@mbork.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118903 Archived-At: --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 07, 2018 at 08:56:23AM +0100, Marcin Borkowski wrote: > Hi all, >=20 > it seems that when I `princ' something with text properties (e.g., > colored faces) in batch mode, the colors disappear. =46rom 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. > 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? Cheers -- tom=C3=A1s --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlwKMl4ACgkQBcgs9XrR2kZdyQCggNqOTTeQVsuFX6X9neLwxren 2r0AnjlIanwlC1k1XdA3DabAdZd/RMNP =Y5OK -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--