Phillip Lord writes:
> >>>>> "Paul" == Paul Kinnucan <[EMAIL PROTECTED]> writes:
>
> Paul> Phillip Lord writes:
> >>
> >>
> >>
> >> Is there anyway to augment the prj.el with hand written lisp?
> >>
>
> Paul> What's wrong with writing a project hook function (see
> Paul> jde-project-hooks)?
>
>
> Ah. Okay. I wasn't aware of this hook. This should help.
>
It's functionally equivalent to puttting code into the project file.
> I've also had a pick through the jde code and found
> jde-loading-project-file variable, which solves my other problem,
> which was how to specify the path to the additional lisp relative to
> the project file.
>
> Currently I have....
>
> base/src/prj.el
> base/scripts/emacs/blah.el
>
> Now relatively paths work for most jde variables. So....
>
> '(jde-db-source-directories (quote ("../src")))
>
> does what it says on the tin.
>
> However (load "../scripts/emacs/blah.el") fails because the
> relative path is wrong.
>
It's hard to understand what you are trying to accomplish.
The JDEE already provides a project file relative path scheme
based on assigning a special meaning to the . character, i.e.,
relative to the path of the project file. If you put the prj.el
file in the root of the project directory, it is trivial to
address all other paths in the project directory trivially.
You can even do thinks like ./../somedir, which addresses
a directory at the same level as the root of the project
directory.
>
>
> >> I have tried writing lisp directly into the prj.el file, but this
> >> doesn't work well for two reasons. Firstly JDE keeps on kill the
> >> buffer after project switching.
>
> Paul> ????
>
> I found that I had to keep on opening prj.el. Something was killing
> the buffer. I presume that when saving the project file (C-cC-vC-p)
> you open the project file, fill it full of custom stuff, and then kill
> it again. Even if it was open in the first place.
>
Why is it necessary to keep the pjr.el file open? It gets evaluated
only when you open a Java file. After that, it just takes up
space.
> I haven't investigated this fully as its a minor issue for
> me. Personally I like to keep autocoded lisp and hand coded lisp
> separately. My .emacs for instance has only a add-to-path, and load in
> it these days. Its a custom only thing!
>
>
> >> Secondly for reasons I have not quite worked out yet, it seems to
> >> remove all empty lines which makes the hand written code
> >> unreadable.
> >>
>
> Paul> This happens only to the code from the beginning of the file
> Paul> to the end of the jde-set-variables form. Code inserted after
> Paul> the form is not touched.
>
>
> My experience has been that forms after the jde-set-variables have odd
> things happen to them. Certainly the first form gets shoved straight
> against the end of the jde-set-variables. For example
>
>
> STUFF REMOVED from beginning of form.
> '(jde-help-docsets (quote (("User (javadoc)"
>"http://www.cs.man.ac.uk/campusonly/jdk1.4/docs/api" nil) ("User (javadoc)"
>"../docs/javadocs" nil)))))
> (defun oiled-generate-boilerplate-function()
> ;; insert the boilerplate
> (insert (jde-gen-create-buffer-boilerplate))
> STUFF REMOVED
>
>
>
> I tried sticking a comment after the jde-set-variables as a
> delimiter, and that seemed to do strange things (I got more than one
> set-variables form).
>
>
The prj.el file is intended only for the JDEE's use. It doesn't take
any pains to preserve alien code.
> I would still like to separate out hand coded and auto coded stuff
> though, so all of this is perhaps moot.
>
>
>
> >> The problem I have is this. I would like to set up
> >> jde-db-source-directories so that it works automatically for
> >> people. I currently have it set up to "../src" which is
> >> appropriate for the project.
>
> >> However this does not include the java.* source which is a, er,
> >> source of irritation to me. As developers are using a variety of
> >> platforms, I need to use different paths, to get to networked
> >> versions of the JDK source accessible. I have similar problems
> >> with setting up docsets.
> >>
>
> Paul> How about an environment variable that specifies the JDK used
> Paul> by a particular developer? e.g., (./src $JDK/src)
>
>
> Thats not a bad idea actually, although it would require the
> developers to set up the environment variable. Ideally I would like to
> have it just do the right thing.
>
>
> I think I can now achieve what I want. Could I suggest an enhancement
> of the documentation to jde-loading-project, and jde-project-hooks
> which might make things clearer?
>
>
> So perhaps...
>
> (defcustom jde-project-hooks nil
> "Specifies a list of functions to be run when a project
> becomes active. The JDE runs the project hooks after
> the jde-mode hooks, and after variables have been set according to the
> information in the project file. See the variable
> `jde-loading-project' for hook functions which need access to the
> location of the project file"
> :group 'jde-project
> :type '(repeat (function :tag "Function")))
>
>
> (defvar jde-loading-project nil
> "Specifies the last project file to have been loaded.
> This variables is mainly for use by the project loading system, and
> should not be set by the user. It may be of use for functions placed
> in `jde-project-hooks'.")
>
jde-find-project-file returns the path of the project file for
the current project.
- Paul