From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: accessing org-lowest-priority in .emacs Date: Thu, 16 Jun 2011 09:39:06 -0400 Message-ID: <9626.1308231546@alphaville.dokosmarshall.org> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXCnI-0006kD-J9 for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 09:39:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXCnA-0007HU-Rm for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 09:39:35 -0400 Received: from vms173009pub.verizon.net ([206.46.173.9]:46125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXCn9-0007Fl-0J for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 09:39:27 -0400 Received: from alphaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173009.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LMV00KJ2XX7HZ70@vms173009.mailsrvcs.net> for emacs-orgmode@gnu.org; Thu, 16 Jun 2011 08:39:13 -0500 (CDT) In-reply-to: Message from "Filippo A. Salustri" of "Thu, 16 Jun 2011 07:35:36 EDT." 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: "Filippo A. Salustri" Cc: nicholas.dokos@hp.com, emacs-orgmode mailing list 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