From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: ANN: org-eval-light.el was: Re: Embedded elisp formulas, was: Spreadsheet and weighted means Date: Wed, 08 Oct 2008 16:12:29 -0700 Message-ID: <87r65pvekk.fsf@gmail.com> References: <87wsh7w589.fsf@selenimh.orion.org> <9136F031-BBCD-4A80-A117-6047C5D3F777@uva.nl> <87y718nu0l.fsf@selenimh.orion.org> <871vz0t7z5.fsf_-_@gmail.com> <87prmk5ab6.fsf@gmail.com> <87y717uamj.fsf@gmail.com> <83E74583-842D-472D-98BD-3F445ED64FA4@uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KxtUK-0002c6-75 for emacs-orgmode@gnu.org; Wed, 05 Nov 2008 20:16:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KxtUI-0002bq-6R for emacs-orgmode@gnu.org; Wed, 05 Nov 2008 20:16:43 -0500 Received: from [199.232.76.173] (port=51555 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxtUI-0002bj-2o for emacs-orgmode@gnu.org; Wed, 05 Nov 2008 20:16:42 -0500 Received: from rv-out-0708.google.com ([209.85.198.242]:28759) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KxtUH-0001xm-My for emacs-orgmode@gnu.org; Wed, 05 Nov 2008 20:16:41 -0500 Received: by rv-out-0708.google.com with SMTP id k29so370714rvb.6 for ; Wed, 05 Nov 2008 17:16:40 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Paul R , emacs-orgmode@gnu.org > 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 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 | ;; 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 http://github.com/eschulte/org-contrib/tree/master/org-eval-light.el As a side note, I feel that org-mode should be listed here http://www.reproducibleresearch.org/tools_and_resources.html Thanks -- Eric