From mboxrd@z Thu Jan 1 00:00:00 1970 From: LanX Subject: hyperlinks executing multiline code snippets? Date: Fri, 10 Dec 2010 16:20:31 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2028476247==" Return-path: Received: from [140.186.70.92] (port=55875 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR4ly-0005K3-Og for emacs-orgmode@gnu.org; Fri, 10 Dec 2010 10:20:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PR4lt-0000c1-9F for emacs-orgmode@gnu.org; Fri, 10 Dec 2010 10:20:38 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:52489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PR4lt-0000bp-4T for emacs-orgmode@gnu.org; Fri, 10 Dec 2010 10:20:33 -0500 Received: by wyj26 with SMTP id 26so3756746wyj.0 for ; Fri, 10 Dec 2010 07:20:31 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============2028476247== Content-Type: multipart/alternative; boundary=00163642724925160404970fe51d --00163642724925160404970fe51d Content-Type: text/plain; charset=ISO-8859-1 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. for perl code I'll need to escape certain characters when using [[shell:...] or [[elisp:...] my second idea was org-babel, but AFAI see 1. it seems to execute code-snippets only when exporting 2. the code can't be hidden behind a NAME in a link text Is there a way to combine both ways? A hyperlink which executes a codesnippet (which is per default folded away)? something like? * [[exec:following snippet][name] #+begin_src perl for $i (1..9){ print $i; } #+end_src or * Title #+begin_src perl :hyperlink name for $i (1..9){ print $i; } #+end_src Thanks for any help -- rolf --00163642724925160404970fe51d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi

Don't know if this is trivially answered...

I'm th= inking about using org-mode for a collection of code-snippets which are exe= cuted 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. for=A0= perl=A0 code I'll need to escape certain characters when using [[shell= :...] or [[elisp:...]

my second idea was org-babel, but AFAI see 1. it seems to execute code-snippets only when exporting
2. the code ca= n't be hidden behind a NAME in a link text

Is there a way to co= mbine both ways?

A hyperlink which executes a codesnippet (which is= per default folded away)?

something like?
* [[exec:following snippet][name]
#+begin_src perl
for $i= (1..9){
print $i;
}
#+end_src
=

or


* Title
#+begin_src perl :hyperlink name
for $i (1..9){
print $i;
}
#+end_src


Thanks for any help

-- rolf
--00163642724925160404970fe51d-- --===============2028476247== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============2028476247==--