From mboxrd@z Thu Jan 1 00:00:00 1970 From: LanX Subject: hyperlinks executing multiline code snippets? Date: Fri, 10 Dec 2010 16:52:52 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1674510704==" Return-path: Received: from [140.186.70.92] (port=41568 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR5HK-0008OE-Bl for emacs-orgmode@gnu.org; Fri, 10 Dec 2010 10:53:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PR5HC-0001ph-8t for emacs-orgmode@gnu.org; Fri, 10 Dec 2010 10:53:02 -0500 Received: from mail-ey0-f177.google.com ([209.85.215.177]:59609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PR5HB-0001pc-Tm for emacs-orgmode@gnu.org; Fri, 10 Dec 2010 10:52:54 -0500 Received: by eyd9 with SMTP id 9so3260984eyd.36 for ; Fri, 10 Dec 2010 07:52:52 -0800 (PST) In-Reply-To: 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 --===============1674510704== Content-Type: multipart/alternative; boundary=001485f791e4d89ffc04971058fb --001485f791e4d89ffc04971058fb Content-Type: text/plain; charset=ISO-8859-1 (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. 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 > --001485f791e4d89ffc04971058fb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable (hope this will not produce a duplicate post)

Hi

Do= n'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 o= rgs 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]<=
br>#+begin_src perl
for $i (1..9){
print $i;
}
#+end_src

or

<= br>
* Title
#+begin_src perl :hyperlink name
f= or $i (1..9){
print $i;
}
#+end_src


Thanks for any help

-- rolf

--001485f791e4d89ffc04971058fb-- --===============1674510704== 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 --===============1674510704==--