From mboxrd@z Thu Jan 1 00:00:00 1970 From: LanX Subject: hyperlinks executing multiline code snippets? Date: Fri, 10 Dec 2010 17:14:26 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2103944497==" Return-path: Received: from [140.186.70.92] (port=52820 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR5cD-0007bb-Bi for emacs-orgmode@gnu.org; Fri, 10 Dec 2010 11:14:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PR5cC-0006yI-Dp for emacs-orgmode@gnu.org; Fri, 10 Dec 2010 11:14:37 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:38154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PR5cC-0006y8-4f for emacs-orgmode@gnu.org; Fri, 10 Dec 2010 11:14:36 -0500 Received: by wwb17 with SMTP id 17so3827127wwb.30 for ; Fri, 10 Dec 2010 08:14:35 -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 --===============2103944497== Content-Type: multipart/alternative; boundary=0016364c7e7d7d3697049710a66f --0016364c7e7d7d3697049710a66f 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 > PS hope this will not produce a duplicate post, "gmail" != "googlemail" confusion --0016364c7e7d7d3697049710a66f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi

Don&#= 39;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

PS hope this will not produce a duplicate post, "gma= il" !=3D "googlemail" confusion
--0016364c7e7d7d3697049710a66f-- --===============2103944497== 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 --===============2103944497==--