From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Creating live elisp link Date: Tue, 19 Mar 2013 21:44:38 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b111e8d0a8c8104d85234f5 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI91B-0001OS-IK for emacs-orgmode@gnu.org; Tue, 19 Mar 2013 22:44:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI916-0006Fs-K5 for emacs-orgmode@gnu.org; Tue, 19 Mar 2013 22:44:45 -0400 Received: from mail-da0-x22a.google.com ([2607:f8b0:400e:c00::22a]:57899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI916-0006FU-Dl for emacs-orgmode@gnu.org; Tue, 19 Mar 2013 22:44:40 -0400 Received: by mail-da0-f42.google.com with SMTP id n15so683002dad.29 for ; Tue, 19 Mar 2013 19:44:39 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --047d7b111e8d0a8c8104d85234f5 Content-Type: text/plain; charset=ISO-8859-1 I'm trying to create a link that takes an elisp expression and evaluates it in another buffer. Here's what I've come up with 1. C-c C-l 2. choose elisp: 3. In the mini buffer: Link: elisp:(with-output-to-temp-buffer "scratch" (print 20)) Description: Print 20 Okay, this calls up the scratch buffer and prints out 20. But how would I call up scratch and, say, change its mode to lisp with (lisp-interaction-mode)? I can try: Link: elisp:(with-output-to-temp-buffer "scratch" (eval '(lisp-interaction-mode))) but this only seems to change my active org file's org-mode to lisp-interaction-mode. Not a pretty sight. My Messages says: Execute "(with-output-to-temp-buffer "scratch" (eval '(lisp-interaction-mode)))" as elisp? y (with-output-to-temp-buffer "scratch" (eval '(lisp-interaction-mode))) => nil But of course [[elisp:(zone)][zone]] is kinda exciting... What am I doing wrong? LB --047d7b111e8d0a8c8104d85234f5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm trying to create a link that takes an elisp expression and evaluate= s it in another buffer. Here's what I've come up with

1. C-c C-l
2. choose elisp:
3. In the mini buffer= :
=A0 =A0 Link: elisp:(with-output-to-temp-buffer "scratch" (p= rint 20))
=A0 =A0 Description: Print 20

= Okay, this calls up the scratch buffer and prints out 20. But how would I c= all up scratch and, say, change its mode to lisp with (lisp-interaction-mod= e)? I can try:

=A0Link: elisp:(with-output-to-temp-buffer "scratc= h" (eval '(lisp-interaction-mode)))

but t= his only seems to change my active org file's org-mode to lisp-interact= ion-mode. Not a pretty sight. My Messages says:

Execute "(with-output-to-temp-buffer "sc= ratch" (eval '(lisp-interaction-mode)))" as elisp? =A0y
=
(with-output-to-temp-buffer "scratch" (eval '(lisp-inter= action-mode))) =3D> nil

But of course
=A0[[elisp:(zone)][zone]]
=

is kinda exciting...

Wha= t am I doing wrong?

LB
--047d7b111e8d0a8c8104d85234f5--