From mboxrd@z Thu Jan  1 00:00:00 1970
From: Eric Schulte <schulte.eric@gmail.com>
Subject: Re: Adding xmpfilter as a results type
Date: Fri, 10 Jun 2011 10:52:06 -0600
Message-ID: <87fwnhvdc9.fsf@gmail.com>
References: <BANLkTin75CmMqhnvApjzN7ZHuuxM3FSKXw@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain
Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
Received: from eggs.gnu.org ([140.186.70.92]:50253)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <schulte.eric@gmail.com>) id 1QV4wR-0006x3-WA
	for emacs-orgmode@gnu.org; Fri, 10 Jun 2011 12:52:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <schulte.eric@gmail.com>) id 1QV4wQ-0000H4-FX
	for emacs-orgmode@gnu.org; Fri, 10 Jun 2011 12:52:15 -0400
Received: from mail-pw0-f41.google.com ([209.85.160.41]:59771)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <schulte.eric@gmail.com>) id 1QV4wQ-0000Gq-89
	for emacs-orgmode@gnu.org; Fri, 10 Jun 2011 12:52:14 -0400
Received: by pwi12 with SMTP id 12so1603388pwi.0
	for <emacs-orgmode@gnu.org>; Fri, 10 Jun 2011 09:52:13 -0700 (PDT)
In-Reply-To: <BANLkTin75CmMqhnvApjzN7ZHuuxM3FSKXw@mail.gmail.com> (Avdi
	Grimm's message of "Fri, 10 Jun 2011 00:42:13 -0400")
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: </archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org
Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org
To: avdi@avdi.org
Cc: emacs-orgmode <emacs-orgmode@gnu.org>

Hi Avdi,

Good idea!  This was easy to implement (the hardest part was installing
rcodetools).  The current Org-mode git head now supports a new result
type "xmp" which behaves as follows...

  #+begin_src ruby :results xmp code
    2 + 2 # =>
    3.times{ puts :hello }
  #+end_src

  #+results:
  #+BEGIN_SRC ruby
  2 + 2 # => 4
  3.times{ puts :hello }
  # >> hello
  # >> hello
  # >> hello
  #+END_SRC

Cheers -- Eric

Avdi Grimm <groups@inbox.avdi.org> writes:

> Something I've been thinking about lately...
>
> If you have used Ruby you might be familiar with the 'xmpfilter'
> command which comes in the 'rcodetools' package. It's a filter that
> annotates a source file with the results of expressions, so:
>
>     1 + 1 # =>
>
> When run through xmpfilter would become:
>
>     1 + 1 # => 2
>
> There's already an rcodetools.el which makes it pretty easy to run
> xmpfilter over the current region, or a whole buffer of Ruby code. But
> it would be sweet if this could become an alternate :results type for
> Ruby source listings, so I could just hit C-c C-c and get the
> xmpfilter version of the code.
>
> Any thoughts on how to make this work?

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/