branch: master
commit f213965b93b982d406404529503ed3346c983dac
Author: Filipp Gunbin
Commit: Filipp Gunbin
packages/javaimp: full rewrite
* Use defstruct's from cl-lib.
* Parse pom.xml structure into tree for correct updates.
* Clean up docs.
* Simplify code.
---
packages/javaimp/javaimp.el | 1200 +--
1 files changed, 597 insertions(+), 603 deletions(-)
diff --git a/packages/javaimp/javaimp.el b/packages/javaimp/javaimp.el
index df402ce..a32a9a0 100644
--- a/packages/javaimp/javaimp.el
+++ b/packages/javaimp/javaimp.el
@@ -1,79 +1,56 @@
;;; javaimp.el --- Add and reorder Java import statements in Maven projects
-*- lexical-binding: t; -*-
-;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2015, 2016 Free Software Foundation, Inc.
;; Author: Filipp Gunbin
;; Maintainer: Filipp Gunbin
-;; Version: 0.6
+;; Version: 0.7
;; Keywords: java, maven, programming
;;; Commentary:
;; Allows to manage Java import statements in Maven projects.
;;
-;; Quick start: customize `javaimp-import-group-alist', `javaimp-jdk-home'
-;; and call `javaimp-maven-visit-root', then in a Java buffer visiting a
-;; file under that module or one of its submodules call
-;; `javaimp-organize-imports' or `javaimp-add-import'. `javaimp-add-import'
-;; will provide you a helpful completion, and the default value (the one
-;; you'll get if you hit `M-n' in the minibuffer) is the symbol under point,
-;; so usually it's enough to hit `M-n', then add some starting letters of a
-;; package and hit `TAB'. The module does not add all needed imports
-;; automatically! It only helps you to quickly add imports when stepping
-;; through compilation errors.
+;; Quick start:
;;
+;; - customize `javaimp-import-group-alist'
+;;
+;; - call `javaimp-maven-visit-project', giving it the top-level project
+;; directory where pom.xml resides
+;;
+;; Then in a Java buffer visiting a file under that project or one of its
+;; submodules call `javaimp-organize-imports' or `javaimp-add-import'.
+;;
+;; This module does not add all needed imports automatically! It only helps
+;; you to quickly add imports when stepping through compilation errors.
+;;
+;;
+;; Some details:
+;;
;; If Maven failed, you can see its output in the buffer named by
;; `javaimp-debug-buf-name' (default is "*javaimp-debug*").
;;
;; Contents of jar files and Maven project structures (pom.xml) are cached,
;; so usually only first command should take a considerable amount of time
-;; to complete. When it is detected that a particular jar or pom.xml file's
-;; timestamp changed, it is re-read and cache is updated.
+;; to complete. If a modules's pom.xml or any of its parents' pom.xml was
+;; changed (i.e. any of them was modified after information was loaded),
+;; `mvn dependency:build-classpath' is re-run on the current module. If a
+;; jar file was changed, its contents are re-read.
;;
-;; Details on variables.
-;;
-;; `javaimp-import-group-alist' defines the order of import statement
-;; groups. By default java.* and javax.* imports are assigned an order of
-;; 10, which is low, so it puts those imports at the beginning. Your
-;; project's imports typically should come after, so the sample config below
-;; sets 80 for them.
-;;
-;; `javaimp-jdk-home' is a path for JDK. It is used to scan JDK jars.
-;; Usually you will need to set this.
+;; If you make some changes which change project hierarchy, you should
+;; re-visit the parent again with `javaimp-maven-visit-project'.
;;
-;; `javaimp-additional-source-dirs' is a list specifying directories where
-;; additional (e.g. generated) source files reside. Each directory is a
-;; relative path from ${project.build.directory} project property value.
+;; Currently inner classes are filtered out from completion alternatives.
+;; You can always import top-level class and use qualified name.
;;
-;; `javaimp-mvn-program' defines path of the `mvn' program. Use if it's
-;; not on `exec-path'.
-;;
-;; `javaimp-cygpath-program' defines path of the `cygpath' program (applies
-;; to Cygwin only, of course). Use if it's not on `exec-path'.
-;;
-;; `javaimp-jar-program' defines path of the `jar' program. Use if it's
-;; not on `exec-path'.
-;;
-;; Details on commands.
;;
-;; `javaimp-maven-visit-root' is the first command you should issue to
-;; use this module. It reads the pom structure recursively and records
-;; which files belong to which module. Maven help:effective-pom command is
-;; used to do that.
-;;
-;; `javaimp-organize-imports' groups import statement and writes those
-;; group according to the value of `javaimp-import-group-alist'. Imports
-;; which are not matched by any regexp in that variable are assigned a
-;; default order defined by `javaimp-import-default-order' (50 by default).
-;;
-;; Sample setup (put this into your .emacs):
+;; Example of initialization:
;;
;; (req