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