emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Paul R <paul.r.ml@gmail.com>
Cc: Carsten Dominik <dominik@uva.nl>, emacs-orgmode@gnu.org
Subject: Re: Embedded elisp formulas, was: Spreadsheet and weighted means
Date: Wed, 01 Oct 2008 17:03:00 -0700	[thread overview]
Message-ID: <87y717uamj.fsf@gmail.com> (raw)
In-Reply-To: <87prmk5ab6.fsf@gmail.com> (Paul R.'s message of "Wed, 01 Oct 2008 22:29:01 +0200")

Paul R <paul.r.ml@gmail.com> writes:

> On Wed, 01 Oct 2008 12:45:34 -0700, "Eric Schulte" <schulte.eric@gmail.com> 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

  reply	other threads:[~2008-10-02  0:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-20  7:00 Spreadsheet and weighted means Nicolas Goaziou
2008-09-29  8:43 ` Carsten Dominik
2008-09-29  8:44   ` Carsten Dominik
2008-10-01 16:46   ` Nicolas Goaziou
2008-10-01 19:26     ` Carsten Dominik
2008-10-01 19:45       ` Embedded elisp formulas, was: " Eric Schulte
2008-10-01 20:29         ` Paul R
2008-10-02  0:03           ` Eric Schulte [this message]
2008-10-02 11:44             ` Carsten Dominik
2008-10-08 23:12               ` ANN: org-eval-light.el was: " Eric Schulte
2008-11-06  1:19               ` Eric Schulte
2008-11-09  7:02                 ` Carsten Dominik
2008-11-10 19:51                   ` Daniel Clemente
2008-10-04  8:49       ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y717uamj.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=dominik@uva.nl \
    --cc=emacs-orgmode@gnu.org \
    --cc=paul.r.ml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).