At 08:07 PM 7/12/99 -0700, Sandip Chitale wrote:
>JDE and Elisp gurus,
>
>       Here is a suggestion.
>
>I know that JDE looks for the project file (default prj.el) in the
>directory
>(or its parent recursively) of the file being visited in the current
>Buffer.
>
>If one makes a assumption that one stores a project file it the
>directory at the
>root of the package tree this -
>
>JAVASTUFF
>       prj.el
>       com
>               acme
>                       coolstuff
>                               A.java
>                               B.java
>
>how would one go about automatically prepending the JAVASTUFF directory
>(or something like JAVASTUFF/classes for people who like to keep
>java sources separate from classes) to the jde-global-classpath
>variable and make it buffer local.
>
>
>That way one needs to set the CLASSPATH to the fixed external libraries
>only. The root directory of the package is automatically added to the
>CLASSPATH depending on which java file one is working on.
>
>Does this make sense ?
>
>Here is my general idea in terms of lisp code -
>
>  (let ((pro-file (jde-find-project-file default-directory)))
>    (if pro-file
>       (progn
>         (setq output-dir (file-name-directory (expand-file-name pro-file)))
>         (jde-set-variables 
>          '(jde-global-classpath (cons output-dir jde-global-classpath))
>          )
>         )
>      )
>    )
>
>What is the best place to hook this into JDE ?
>
>Could it be jde-load-project-file (obviously protected by a custom
>variable
>along the lines of jde-prepend-package-root-to-global-classpath
>(boolean)
>and jde-prepend-package-root-to-global-classpath-relative-dir (string
>e.g.
>"/classes"))
>

Hi Sandip,

I'm not certain how to incorporate this suggestion as a configurable feature
of the JDE that would be generally useful. The feature, for example, would
not be useful in my case as the projects that I work on generally include
different sets of jars that I would have to specify on a per-project basis
anyway. In your case, I think you could implement the feature by invoking
the necessary lisp in a jde-mode hook function. The jde mode hook function
is invoked after the prj.el file is loaded so anything in the hook function
can override the prj.el file. If you could suggest a way to incorporate this
feature as an easily customizable option, I'd consider including it.

- Paul

Reply via email to