* Adding xmpfilter as a results type
@ 2011-06-10 4:42 Avdi Grimm
2011-06-10 16:52 ` Eric Schulte
0 siblings, 1 reply; 2+ messages in thread
From: Avdi Grimm @ 2011-06-10 4:42 UTC (permalink / raw)
To: emacs-orgmode
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?
--
Avdi Grimm
http://avdi.org
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Adding xmpfilter as a results type
2011-06-10 4:42 Adding xmpfilter as a results type Avdi Grimm
@ 2011-06-10 16:52 ` Eric Schulte
0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2011-06-10 16:52 UTC (permalink / raw)
To: avdi; +Cc: emacs-orgmode
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-10 16:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 4:42 Adding xmpfilter as a results type Avdi Grimm
2011-06-10 16:52 ` Eric Schulte
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).