From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul R Subject: Re: Where to define functions for use with org Date: Thu, 30 Oct 2008 16:47:32 +0100 Message-ID: <87tzauf5kb.fsf@gmail.com> References: <87bpx25eci.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvZkL-00063r-8z for emacs-orgmode@gnu.org; Thu, 30 Oct 2008 11:47:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvZkH-0005zI-Fp for emacs-orgmode@gnu.org; Thu, 30 Oct 2008 11:47:40 -0400 Received: from [199.232.76.173] (port=42429 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvZkH-0005z3-7h for emacs-orgmode@gnu.org; Thu, 30 Oct 2008 11:47:37 -0400 Received: from yw-out-1718.google.com ([74.125.46.152]:26579) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KvZkH-0004ra-8G for emacs-orgmode@gnu.org; Thu, 30 Oct 2008 11:47:37 -0400 Received: by yw-out-1718.google.com with SMTP id 9so256559ywk.66 for ; Thu, 30 Oct 2008 08:47:34 -0700 (PDT) In-Reply-To: <87bpx25eci.fsf@gmail.com> (Daniel Clemente's message of "Thu, 30 Oct 2008 15:47:57 +0100") 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: Daniel Clemente Cc: emacs-orgmode@gnu.org On Thu, 30 Oct 2008 15:47:57 +0100, Daniel Clemente sai= d: Daniel> Maybe there are other methods: ideally something similar to Daniel> Emacs' =E2=80=9Elocal variables=E2=80=9C in headers but for functio= ns. The only difference between a function and a variable in emacs lisp, and in any other Lisp-2, is the register where the name is bound. So if you can store a value in a variable, you can also store some code through the use of (lambda ...). Because of this Lisp-2 design, you will have to call it later with (funcall name arg1 arg2 ...). Try the code below if you want, in emacs : (setq myorgfunction (lambda (a b) (+ a b))) (funcall myorgfunction 5 6) It might help you. --=20 Paul