Phillip Lord writes:
 > >>>>> "Paul" == Paul Kinnucan <[EMAIL PROTECTED]> writes:
 > 
  > 
 >   Paul> Hi Phil,
 > 
 >   Paul> I'd like to suggest another approach to this problem. I've
 >   Paul> implemented it in my sandbox and it seems to work fine. I'd
 >   Paul> like to get feedback from you and others on it.
 > 
 >   Paul> The proposed approach is the following.
 > 
 >   Paul> I have created a new command called jde-customize-option. This
 >   Paul> command displays a standard customization buffer with two
 >   Paul> additional features:
 >   Paul> (1) The "Set" menu has a new "Save to Project"
 >   Paul>     option. Selecting this
 >   Paul> option sets the option to its customized value, saves the
 >   Paul> value in the current project file, and adds the variable to
 >   Paul> the JDEE's dirty variable list. (2) The existing "Erase
 >   Paul> Customization" option now erases the customization and then
 >   Paul> deletes the variable from the current project file. This
 >   Paul> solution not only eliminates the need for a defjdeoption macro
 >   Paul> it also eliminates the need to execute an additional command
 >   Paul> to save or delete the variable from the project
 >   Paul> file. Accordingly, I propose changing the jde-save-project
 >   Paul> option from a command to a function.
 > 
 >   Paul> How does this strike you?
 > 
 > 
 > Paul
 > 
 > I think that this is probably a neater solution than the defjdecustom
 > solution as I said the other day. I thought it would be more work but
 > you seem to have done it quickly enough, so I would definitely go for
 > it. 

I thought it would be more work too until I decided the other
night to see how custom works.

It turns out that the implementation of custom makes it relatively
easy to add to the Set menu. Custom uses a generic widget, called
custom-variable, to edit variables in a customize buffer. The widget,
among other things, defines the Set menu. The customize-variable
command passes this widget along with the symbol to be customized
to the customize-create-buffer function. All I needed to do was
(1) create a derivative of the custom-variable widget, named
jde-custom-variable, that defines the JDEE's version of the Set menu
and (2) create a derivative of the customize-variable command, named 
jde-customize-variable, that passes jde-custom-variable (instead
of custom-variable) to the customize-create-buffer function.

I plan to create a similar variant of customize-group for 
customizing groups of JDEE variables.

 > 
 > On the second topic, that is removing jde-save-project as a command, I
 > would disagree. I partially generate my project file using an ant task
 > that I have written, and so I use jde-save-project to create a
 > skeleton. Having said this, I do so rarely so removing it's menu and
 > keybinding would be fine. Of course push comes to shove I can always
 > use `eval-expression'.

I think it would be better to change jde-save-project to be a function
to discourage people from trying to customize variables outside the
customize system and thereby unwittingly corrupt their project files.

 > 
 > I'm quite surprised here. My original patch was just to speed up
 > project file switching rather than anything else. Things seem to have
 > moved further in a short space of time!
 > 

Yes, thanks to you.

Paul

Reply via email to