I'm trying to get JDE to set its classpath according to my environment variables, with some customization done in project files. I'm very close to having this work, but I need some help. I'm trying to do the following. First, I set up a jde-mode-hook to set my default classpath: ;; from .emacs (defun my-jde-mode-hook () ;; grab the CLASSPATH environment settings. (jde-set-global-classpath (getenv "CLASSPATH")) ;; make source path the same as CLASSPATH (setq jde-db-source-directories jde-global-classpath) ) (add-hook 'jde-mode-hook 'my-jde-mode-hook) ;; Then, I use project files when I need to add a classpath: ;; from prj.el ;; adds a path to the global classpath for this project (add-to-list 'jde-global-classpath "c:/the/current/directory") (setq jde-db-source-directories jde-global-classpath) ;; But this doesn't work right for a couple reasons. For one, the prj.el file is run before my mode hook. For this to work the mode hook would have to be run first, and the prj.el second. Also, the mode hook sets the global path every time, wiping out any additions that I've made for specific packages. What I'd really like is to call jde-set-global-classpath only when jde is first loaded, not everytime a java file is loaded (which is when my-jde-mode-hook is run). Is there a hook for this? Also, I'd like my prj.el code above to be run only the first time that prj.el is loaded. Not every time a java file is loaded. I have a feeling this could be accomplished with some slightly more complicated lisp in my prj.el. Can anyone help me with that? Any information would be appreciated. Thanks. -Dave
