[Orgmode] hyperlinks executing multiline code snippets?

2010-12-10 Thread LanX
Hi Don't know if this is trivially answered... I'm thinking about using org-mode for a collection of code-snippets which are executed by a click on a link My first idea was to use orgs hyperlink syntax but there I have two problems 1. something like [[shell:code][NAME]] can't be

Re: [Orgmode] hyperlinks executing multiline code snippets?

2010-12-10 Thread Eric Schulte
Hi LanX, The following two options come to mind, although I'm not sure if any are exactly what you're after. * named code block and a #+call: line #+source: counter #+begin_src perl :results output :var to=5 for $i (1..$to){ print $i; } #+end_src #+results: counter : 12345 #+call:

Re: [Orgmode] hyperlinks executing multiline code snippets?

2010-12-10 Thread LanX
Hi Eric Thanks looks promising but I'm having problems to use it. I noticed that babel is not a part of 6.30trans and did an upgrade to the latest current version 7.4. Unfortunately it's causing problems (all I did was updating a sym-link to the new package) Am I supposed to set additional

Re: [Orgmode] hyperlinks executing multiline code snippets?

2010-12-10 Thread LanX
ARGH .. ... just realised that I still need to run the makefile for installation. Sorry! :) 2010/12/10 LanX lanx.p...@googlemail.com Hi Eric Thanks looks promising but I'm having problems to use it. I noticed that babel is not a part of 6.30trans and did an upgrade to the latest current

[Orgmode] hyperlinks executing multiline code snippets?

2010-12-10 Thread LanX
Hi Don't know if this is trivially answered... I'm thinking about using org-mode for a collection of code-snippets which are executed by a click on a link My first idea was to use orgs hyperlink syntax but there I have two problems 1. something like [[shell:code][NAME]] can't be multiline 2.

[Orgmode] hyperlinks executing multiline code snippets?

2010-12-10 Thread LanX
(hope this will not produce a duplicate post) Hi Don't know if this is trivially answered... I'm thinking about using org-mode for a collection of code-snippets which are executed by a click on a link My first idea was to use orgs hyperlink syntax but there I have two problems 1.

Re: [Orgmode] hyperlinks executing multiline code snippets?

2010-12-10 Thread LanX
Hi Eric thanks, after some fiddling I was able to make it work... But do I get it right? The snippet has to be explicitely named, I can't tell the hyperlink just to take the next block? Before I start trying it, is it theoretically possible to write an on ob-multiline.el which parses the

Re: [Orgmode] hyperlinks executing multiline code snippets?

2010-12-10 Thread LanX
Before I start trying it, is it theoretically possible to write an on ob-multiline.el which parses the following lines? I.e. is the current point known at execution time? it works. I managed to create a new lisp defun which parses the following text, extracts the code and executes it!