emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Creating live elisp link
@ 2013-03-20  2:44 Lawrence Bottorff
  2013-03-20  3:15 ` Samuel Wales
  0 siblings, 1 reply; 2+ messages in thread
From: Lawrence Bottorff @ 2013-03-20  2:44 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 907 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1284 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-20  3:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20  2:44 Creating live elisp link Lawrence Bottorff
2013-03-20  3:15 ` Samuel Wales

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).