Any votes for including this into the contrib directory?
- Carsten
On Nov 6, 2008, at 2:19 AM, Eric Schulte wrote:
Carsten Dominik <[EMAIL PROTECTED]> writes:
Before starting to use org-eval.el, I'd like to make sure that
everyone understands that loading org-eval.el turns any org-mode file
into an executable. That means that you have to start being careful
with org-mode files you receive from others or download from the
internet. Just like you would run a program from the web only if you
trust the source, you should then only load such files into Emacs if
you trust the source. I am not saying this to keep you from using
org-
eval, I am am using it myself, but please be aware of this issue.
One more remark: a <lisp> tag is evaluated by jit-lock (i.e. by the
font-lock mechanism), just before Emacs tries to make it visible.
The
reason for this is that the original indent for this functionality
was
to produce and display dynamic content on a page. In large files,
font locking can be delayed until the segment in question comes into
view in the Emacs window.
To be sure to get this code evaluated immediately when visiting a
file, you might want to put the snippets close to the beginning of
the file.
I've made some changes to org-eval and packaged them into a new
org-eval-light.el file. While this reworked version loses some of the
automatic evaluation, and most all of the similarity to Emacs Muse
that
the original org-eval tried to maintain, I believe that it represents
(for me at least) a safer and more use-able way of packaging and
calling
source code from inside of org-files.
The changes include...
,----[org-eval-light.el]
| ;;; Changes: by Eric Schulte
| ;;
| ;; 1) forms are only executed manually, (allowing for the
execution of
| ;; an entire subtree of forms)
| ;; 2) use the org-mode style src blocks, rather than the muse style
| ;; <code></code> blocks
| ;; 3) forms are not replaced by their outputs, but rather the output
| ;; is placed in the buffer immediately following the src block
| ;; commented by `org-eval-light-make-region-example' (when
| ;; evaluated with a prefix argument no output is placed in the
| ;; buffer)
| ;; 4) add defadvice to org-ctrl-c-ctrl-c so that when called
inside of
| ;; a source block it will call `org-eval-light-current-snippet'
`----
The amount of new code is minimal, but I think it provides a nice
alternative for source code evaluation, and hopefully takes org-mode
one
step closer to being a first-class Experimentation and
Reproducible-Research tool. The code is available here
http://github.com/eschulte/org-contrib/tree/master%2Forg-eval-light.el?raw=true
As a side note, I feel that org-mode should be listed here
http://www.reproducibleresearch.org/tools_and_resources.html
Thanks -- Eric
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode