Paul,

You are right that things like jde-gloabl-classpath works already.  So
whatever I did wouldn't have any effect on them.  I was wrong when I
applied them to the change I made.  However, the change I made is
still valid.

The original intention of the changes are targeted to the statements
outside of the jde-set-variable block. (I should have sticked to that
instead of broaden that to those inside).  Currently if we define
anything outside of that block, it will be loaded under the deepest
originating project's directory.  For example, jde-ant-buildfile.  If
you define a relative dir to this variable in /somewhere/src, and try
to run the build under /somewhere/src/cp1, that relative path would be
wrong because it will be relative to cp1.

I don't know if it is the intention of the design to allow people
define things outside the the jde-set-variable block.  I want to do it
because I can have a lot of project specific things defined here.  One
example is there are different code convention for the indentation in
different projects.  I can set it differently in different prj.el
files.

In terms of the term "relative", I mean "./classes == prj-dir/classes".

Thanks.

Ping




On Tue, 31 Aug 2004 10:44:13 -0400, Paul Kinnucan <[EMAIL PROTECTED]> wrote:
> Ping Liang writes:
> > I made some modification to the function jde-load-project-file in
> > jde.el so that when each project file is loaded, the default directory
> > is set the directory where this project file is in.  See change below.
> >
>
> Hi Ping,
>
> I don't understand how your change works. I haven't looked at
> the project file code in a long time but as far as I remember, it does not
> use or depend on the default directory in any way. Relative paths in
> jde-global-classpath and jde-sourcepath are resolved at compile- or
> run-time, not when the project file is loaded, i.e., loading a project
> does not resolve the relative path: ./classes.
>
> Further, it is not clear to me in which sense you are using "relative
> path."  Are you using it in the sense of the JDEE's project-relative
> path feature where the JDEE resolves the period in a path (e.g.,
> ./classes == prj-dir/classes) or in the traditional sense where Emacs
> or the host operating system resolves the period in a relative path
> (e.g., ./classes == curr_dir/classes)?
>
> I need to know in which sense you are using the term in order to
> understand what problem you are trying to solve.
>
> Paul
>
>
>
>
> > This change is very important because this makes relative path
> > possible under the following scenario.
> >
> > Assuming you have the dir structure like this,
> >
> > /somewhere/lib
> > /somewhere/src
> > /somewhere/src/cp1
> > /somewhere/src/cp2
> >
> > I usually put prj.el files in src, cp1 and cp2.  This means the
> > settings I put in src is common to cp1 and cp2, so I don't have to
> > define them again in prj.el in the subdirs. This has been OK as long
> > as I don't use relative path in settings like jde-global-classpath.
> > If I do, the relative path in src/prj.el becomes relative to the
> > bottom-most prj.el's directory (such as /src/cp1) and all the settings
> > in src/prj.el having relative path would point to the wrong directory.
> >  This also affects the variables I defined outside of the
> > jde-set-variable block. As a work-around, I have been redefining these
> > variable in each prj.el file.  This does not look good; it defeats the
> > purpose of having a common prj.el file.
> >
> > I have to use relative path and strongly suggest others do the same.
> > This way, I can check out the source code from revision control system
> > to any directory I want and start using JDE right away, without having
> > to change the absolute path. Besides, none of the other IDEs are able
> > to use relative path (let me know if you found one) and Emacs (JDEE)
> > is the one that stands out.
> >
> > Here is the changed code segment in jde.el,
> >
> >    (if prj-files
> >      (progn
> >        (jde-set-variables-init-value)
> >        (setq default-directory-backup default-directory) ;; ping
> >        (loop for file in prj-files do
> >          (setq jde-loading-project file)
> >          (jde-log-msg "jde-load-project-file: Loading %s" file)
> >          ;; reset project file version
> >          (setq jde-loaded-project-file-version nil)
> >          (setq default-directory (file-name-directory file)) ;; ping
> >          (load-file file)
> >          (setq jde-loading-project nil))
> >         (setq default-directory default-directory-backup) ;; ping
> >       (run-hooks 'jde-project-hooks))...
> >
> > Regards,
> >
> > Ping
>
>

Reply via email to