[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] ANN: org-eval-light.el was: Re: Embedded elisp formulas, was:
[Orgmode] ANN: org-eval-light.el was: Re: Embedded elisp formulas, was: Spreadsheet and weighted means
Thu, 06 Nov 2008 01:16:44 -0000
> 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
> 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...
| ;;; 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. Here is a link to the code
As a side note, I feel that org-mode should be listed here
Thanks -- Eric
- [Orgmode] ANN: org-eval-light.el was: Re: Embedded elisp formulas, was: Spreadsheet and weighted means,
Eric Schulte <=