I must be a moron. But I'm still having problems. Here's what's in my Preferences.el: .... (require 'org-install) (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) ; use it for *.org. (add-hook 'org-mode-hook 'turn-on-font-lock) ; font lock on always. (defvar fas/org-priority-scale (/ (* 1000 (- org-lowest-priority org-highest-priority)) 10)) .... When I start aquamacs, I get an error that org-lowest-priority is not defined. Help? 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/