From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johan Andersson Newsgroups: gmane.emacs.help Subject: Re: Redirect Output Date: Tue, 30 Mar 2010 22:14:52 +0000 Message-ID: <929ccd881003301514n1aa14473kffd0c4fb37d022dc@mail.gmail.com> References: <929ccd881003301423r6e405f6fped5d5849b7899831@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6d645446e598104830bf50f X-Trace: dough.gmane.org 1269987361 18619 80.91.229.12 (30 Mar 2010 22:16:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 30 Mar 2010 22:16:01 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 31 00:15:56 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nwjj2-0000jZ-Hk for geh-help-gnu-emacs@m.gmane.org; Wed, 31 Mar 2010 00:15:56 +0200 Original-Received: from localhost ([127.0.0.1]:41916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwjj1-0000IF-S7 for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Mar 2010 18:15:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwjiV-0000Hb-By for help-gnu-emacs@gnu.org; Tue, 30 Mar 2010 18:15:23 -0400 Original-Received: from [140.186.70.92] (port=35357 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwjiN-0000EV-Bn for help-gnu-emacs@gnu.org; Tue, 30 Mar 2010 18:15:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwjiA-0006pd-Tk for help-gnu-emacs@gnu.org; Tue, 30 Mar 2010 18:15:12 -0400 Original-Received: from mail-ww0-f41.google.com ([74.125.82.41]:45798) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwjiA-0006oY-8n for help-gnu-emacs@gnu.org; Tue, 30 Mar 2010 18:15:02 -0400 Original-Received: by wwb18 with SMTP id 18so163654wwb.0 for ; Tue, 30 Mar 2010 15:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:cc:content-type; bh=c/hc6r3e5V0iTfiufyajaFn3MtUdEw2hIbtzRof390w=; b=FrU5tzMgpFNK3dWJtocX7fbj30Q5b6fasZH9XzJiIZtT3f2mMqDQMJxQiYdUVjOIKc zeFjfSeztw7DwZYpPdsCJ0RKlUVBIqjDBynG+/Lvjh8O4qHypqDv1huj3VxnJkJXfCW0 JVq1m6k6EqyEhVm8aSX4DEIjLGOYcjV6KR0yA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; b=iY9Kxvs70V2At8O49YhMEEfXVmLj5ZFP46kWgQC1oM/nNlN6yO55zw+4Wja8ILsXQ2 vr7VEmP+Dt0oC6+vMfM3gMy5hkVjyMQWkZU4QxGgw9TTmx/s3JVKEvQ+npVTpyXvoaEa GDJmUDQ6WSw23/4ZoUEPEiWSTcoF/VVqdnNKc= Original-Received: by 10.216.20.198 with HTTP; Tue, 30 Mar 2010 15:14:52 -0700 (PDT) In-Reply-To: Original-Received: by 10.216.93.79 with SMTP id k57mr12765wef.161.1269987292370; Tue, 30 Mar 2010 15:14:52 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72548 Archived-At: --0016e6d645446e598104830bf50f Content-Type: text/plain; charset=ISO-8859-1 Lennart, You're almost my private Emacs tutor :) Didn't know about advicing! Looks like it could solve it! I will look into it and get back with the results. But that'll have to wait until tomorrow. Thanks! On Tue, Mar 30, 2010 at 10:08 PM, Lennart Borgman wrote: > On Tue, Mar 30, 2010 at 11:23 PM, Johan Andersson > wrote: > > Hey, > > I have a batch program where I run some Elisp functions and then > print some > > results. The problem is that some of the functions I'm calling produces > > output. And I don't want that. So I'm basically looking for a way to only > > output my printing. > > The first I thought about was redirecting stdout to something else. Like > > this: > > > > #!/usr/bin/emacs --script > > (let* ((buffer (get-buffer-create "output")) > > (standard-output buffer)) > > (print "some printing")) > > > > That works fine, except that it does not bite on message. Like this: > > > > #!/usr/bin/emacs --script > > (let* ((buffer (get-buffer-create "output")) > > (standard-output buffer)) > > (message "some message")) > > > > Any ideas how I can solve this? > > defadvice the `message' function? > --0016e6d645446e598104830bf50f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Lennart, You're almost my = private Emacs tutor :)

Didn't know about advicing! Looks li= ke it could solve it! I will look into it and get back with the results. Bu= t that'll have to wait until tomorrow.

Thanks!

On T= ue, Mar 30, 2010 at 10:08 PM, Lennart Borgman <lennart.borgman@gmail.com> wrote:
On Tue, M= ar 30, 2010 at 11:23 PM, Johan Andersson
<johan.rejeep@gmail.com>= ; wrote:
> Hey,
> I have a batch program where I run some Elisp functions and then print= =A0some
> results. The problem is that some of the functions I'm calling=A0p= roduces
> output. And I don't want that. So I'm basically looking=A0for = a way to only
> output my printing.
> The first I thought about was redirecting stdout to something else. Li= ke
> this:
>
> #!/usr/bin/emacs --script
> (let* ((buffer (get-buffer-create "output"))
> =A0=A0 =A0 =A0 (standard-output buffer))
> =A0=A0(print "some printing"))
>
> That works fine, except that it does not bite on message. Like this: >
> #!/usr/bin/emacs --script
> (let* ((buffer (get-buffer-create "output"))
> =A0=A0 =A0 =A0 (standard-output buffer))
> =A0=A0(message "some message"))
>
> Any ideas how I can solve this?

defadvice the `message' function?

--0016e6d645446e598104830bf50f--