Paul R <[EMAIL PROTECTED]> writes:

> On Wed, 01 Oct 2008 12:45:34 -0700, "Eric Schulte" <[EMAIL PROTECTED]> said:
>
>> This raises an issue I've been running into recently, If I have
>> a multi-line elisp function (I guess same issue would apply for
>> multi-line shell commands) that I want to use from an org file (for
>> example to compute table columns), is there a way to save and load
>> the function from the org file? I've tried multiline [[elisp: ]]
>> links but they don't work well, maybe something like...
>
> maybe you can use the emacs facility to load code when visiting
> a file. For more information, read the following info node :
>     File: emacs,  Node: Specifying File Variables

I looked at this, but then I ran across org-eval.el in the
org/contrib/lisp directory.  With (require 'org-eval) in my .emacs I can
put something like the following

<lisp>
(defun my-specific-function-for-this-file (org-tabl-cell)
  (format "%S"
          (do-something-special
           (read org-tabl-cell))))
</lisp>

in an org file and org-eval is nice enough to evaluate the code defining
the function upon opening the file, to display only the name of the
function in a special face, and to allow me to edit the function in the
appropriate mode with C-' (also works for ruby/shell/python/etc...).
Everything I could have asked for!

It nice to request a feature and find it's already implemented.

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

Reply via email to