Hi All,

Some people have requested that the JDE saved only customized values of JDE
variables in prj.el files. I had agreed this was a good idea and have been
saying that the only fact that JDE is not doing this now is a bug. I went
back and looked at the code and now realize that this is not a bug. The JDE
saves all variables to the prj.el file for a very good reason. Imagine that
you have two projects open and the sets of variables that the projects
customized do not coincide, for example, Project A customizes variables a,
b, c and Project B customizes variables b, c, d. Now consider the following
scenario with only changed variables being updated: 

Action             Customized Variables*
------------------------------------------
Open A                 [a  b  c]
Open B                  a [b  c  d]
Switch to A            [a  b  c] d

* brackes indicate which variables are updated when the buffer 
  is activated.

After just three steps the customized variables equals the union
of the sets of variables customized by each project individually. 
In my original implementation of prj.el files, I had in fact saved only
customized variables in the prj.el file but soon discovered this problem.
I realized that when updating the global variables to reflect a project
switch, I had to update ALL the variables. I had to set the variables
customized by the project to the customized variables and all other
variables to their standard values. So that's why prj.el files work the way
they do. At the time, I was in a hurry to get the prj.el feature out and
resetting all the JDE variables seemed good enough.

Now, however, I'm prepared to revisit this issue. I can think of way to
make this work, for example, when updating variables, I could go through
all the JDE variables and mark those that were customized by the current
project. Variables customized by other open projects would be reset to
their default values.  However, before doing this, I'd be interested in why
people think saving only customized variables is a good idea.

I should also note that I am toying with the idea of having project
hierarchies where subprojects could inherit or override the settings of
parent projects or even those in the .emacs file. The way this would works
is fairly simple, the JDE would apply all the prj.el files found in the
current projects directory tree. Settings found lower down in the tree
would shadow settings higher in the tree (override capability).

- Paul



Reply via email to