Bonjour David! Awesome changes. It works perfectly for me now! Thanks!
It seems I am your main customer these days!! I have a couple of minor
thoughts for you...
I would like to see a little clarity added to a couple of the variable
descriptions to help the immediate understanding of them. Here is what I
noted - small changes:
(defcustom jde-import-reverse-sort-group nil
"*Non-nil to sort each import group's packages in reverse alphabetic
order. See command `jde-import-organize'. Note: For sorting the
groups, see variable 'jde-import-sorted-groups'."
(defcustom jde-import-sorted-groups nil
"*Non-nil to sort the import groups in alphabetic order. See
command `jde-import-organize'. Note: For sorting the packages
within each group, see variable 'jde-import-reverse-sort-group '.
An additional thought, for consistency, I would like to see:
- jde-import-reverse-sort-group
- renamed to jde-import-sort-group-packages
- changed to match jde-import-sorted-groups; a choice with the same
options: none, asc, desc
- jde-import-sorted-groups renamed to jde-import-sort-groups to match
I think the rename would also help a little bit with clarity of purpose.
Finally - what do you think of adding an optional feature to eliminate
duplicate declarations? They do not cause compile errors, but it is great
to have them automatically removed. I think this is one of the finishing
touches for "organizing imports"! e.g.
(defcustom jde-import-duplicate-declarations remove
"*Tells jde-import-organize how to handle duplicate import declarations."
:group 'jde-project
:type '(choice :tag "Duplicate import declaration action"
(const :tag "Remove" remove)
(const :tag "Keep" keep)))
Thanks again for the help and for doing this feature! I look forward to its
addition to the JDE distribution, like the first one you did (I have already
simply replaced in jde-wiz.el the call to (jde-sort-imports) with
(jde-import-organize) and it works great!).
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On
Behalf Of David Ponce
Sent: Friday, November 17, 2000 5:59 AM
To: jde
Cc: david
Subject: Re: FW: Improved command to organize import statements
Hello Jeff,
Thank you again for your feedback :-)
I made a new version jde-import-org.el attached here.
It contains the following changes:
- New `jde-import-group-function' option to specify the function used
to associate import token to group. The default one is
`jde-import-group-of'. This let the user to completely handle the
way imports are grouped.
- New `jde-import-sorted-groups' option to specify if groups will be
sorted. Notice that the *default* group (the one that contains
imports not belonging to any specific group) is allways the last
group.
- Improvement of the function `jde-import-group-of'. For consistency
`jde-import-group-rules' is now `jde-import-group-of-rules' and it
is now possible to associate a group regexp to a particular name.
I was able to organize imports like your need using the following
customization:
- `jde-import-sorted-groups' set to 'asc (Sort groups alphabetically).
- `jde-import-group-of-rules' set to
'(("^\\([^.]+\\([.][^.]+[.]\\)*\\)" . 1)). If you add the rule
("^javax?\\." . "") then standard packages will always go into a
topmost group. Also, you can use ("^javax?\\." . "java") to have all
groups in alphabetic order.
Any feedback will be welcome.
Sincerely,
David