From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Espen Newsgroups: gmane.emacs.help Subject: Re: Examining the output of a shell command? Date: Sun, 28 Jun 2015 10:03:51 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435500321 15207 80.91.229.3 (28 Jun 2015 14:05:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jun 2015 14:05:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 28 16:05:21 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z9DCy-0000NW-IB for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jun 2015 16:05:21 +0200 Original-Received: from localhost ([::1]:39083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9DCx-0001c7-Ct for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jun 2015 10:05:19 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.datemas.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Injection-Info: mx02.eternal-september.org; posting-host="ad871ce417d1fb2ea3c87e49e48c0ae1"; logging-data="13367"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nzM+z6HrngwujjUczn5/f+UcVOWbKz7M=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:RNSbkCNhp6tArS/dTNPLtACyGow= Original-Xref: usenet.stanford.edu gnu.emacs.help:212959 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105245 Archived-At: "Pascal J. Bourguignon" writes: > Raffaele Ricciardi writes: > >> I would like to analyse the escape sequences emitted by a shell >> command. I have tried with `shell-command` and >> `shell-command-to-string`, but escape sequences are stripped away. > > Nope. Try a better lie. > > (shell-command-to-string "echo $RED hello $NORMAL") > --> "[31m hello [0m > " Maybe the OP doesn't realize that some programs that output escape sequences won't do so when run as an Emacs shell command. /bin/ls being a good example. In that case, run: /bin/ls --color as an Emacs shell command. -- Dan Espen