From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Filippo A. Salustri" Subject: Re: accessing org-lowest-priority in .emacs Date: Thu, 16 Jun 2011 11:48:14 -0400 Message-ID: References: <9626.1308231546@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6d7df7474f10704a5d632b9 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXEnq-0006zY-Is for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 11:48:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXEno-0003Nd-Le for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 11:48:18 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:33230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXEno-0003NW-5k for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 11:48:16 -0400 Received: by wyf19 with SMTP id 19so1407358wyf.0 for ; Thu, 16 Jun 2011 08:48:15 -0700 (PDT) In-Reply-To: <9626.1308231546@alphaville.dokosmarshall.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode mailing list --0016e6d7df7474f10704a5d632b9 Content-Type: text/plain; charset=ISO-8859-1 Right. Require. *sigh* Let me just wipe the egg off my face. Thanks. Cheers. Fil On 16 June 2011 09:39, Nick Dokos wrote: > Filippo A. Salustri wrote: > > > > I've got code of this form in my Preferences.el (aquamacs-speak for > .emacs): > > > > (defvar fas/org-some-variable > > (/ 10 (* 1000 (- org-lowest-priority org-highest-priority)))) > > > > But org-lowest-priority & org-highest-priority aren't defined at that > > point in Preferences.el. I need to defer the calculation till org is > > running. > > > > You just need to defer it until org is loaded: just put it after the > (require 'org-install). If you are depending on an autoloaded function > to be called in order to load org, you can just (require 'org) at some > place in Preferences.el and put the defvar after it. Or you can > initialize it in a hook - org-load-hook is the one to use here: > > (add-to-list 'org-load-hook > (function > (lambda () > (setq fas/org-some-variable > (/ 10 (* 1000 (- org-lowest-priority > org-highest-priority))))))) > > Nick > > > > > > > > -- \V/_ Filippo A. Salustri, Ph.D., P.Eng. Mechanical and Industrial Engineering Ryerson University 350 Victoria St, Toronto, ON M5B 2K3, Canada Tel: 416/979-5000 ext 7749 Fax: 416/979-5265 Email: salustri@ryerson.ca http://deseng.ryerson.ca/~fil/ --0016e6d7df7474f10704a5d632b9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Right. =A0Require. *sigh* Let me just wipe the egg off my face.
Thanks.=
Cheers.
Fil

On 16 June 2011= 09:39, Nick Dokos <nicholas.dokos@hp.com> wrote:
Filippo A. Salustri <<= a href=3D"mailto:salustri@ryerson.ca">salustri@ryerson.ca> wrote:

> I've got code of this form in my Preferences.el (aquamacs-speak fo= r .emacs):
>
> (defvar fas/org-some-variable
> =A0 (/ 10 (* 1000 (- org-lowest-priority org-highest-priority))))
>
> But org-lowest-priority & org-highest-priority aren't defined = at that
> point in Preferences.el. =A0I need to defer the calculation till org i= s
> running.
>

You just need to defer it until org is loaded: just put it after the<= br> (require 'org-install). If you are depending on an autoloaded function<= br> to be called in order to load org, you can just (require 'org) at some<= br> place in Preferences.el and put the defvar after it. Or you can
initialize it in a hook - org-load-hook is the one to use here:

(add-to-list 'org-load-hook
=A0 =A0 =A0 =A0 =A0 =A0 (function
=A0 =A0 =A0 =A0 =A0 =A0 =A0 (lambda ()
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(setq =A0fas/org-some-variable
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (/ 10 (* 1000 (- org-lowest-pr= iority org-highest-priority)))))))

Nick










--
\V/_
Filippo= A. Salustri, Ph.D., P.Eng.
Mechanical and Industrial Engineering
Rye= rson University
350 Victoria St, Toronto, ON
M5B 2K3, Canada
Tel: = 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salustri@ryerson.ca
http://deseng.ryerson.ca/~fil/

--0016e6d7df7474f10704a5d632b9--