Skip to content

Commit

Permalink
Cleanup old namespace issues and bump to 1.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeto committed Feb 13, 2016
1 parent 0d53164 commit aacf9ad
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -39,8 +39,8 @@ will operate from its own cache after that.

## Import functions

Two functions for managing Java imports is provided: `add-java-import`
and `sort-java-imports`. The former integrates with the javadoc-lookup
Two functions for managing Java imports is provided: `javadoc-add-import`
and `javadoc-sort-imports`. The former integrates with the javadoc-lookup
index to provide completions.

## History
Expand Down
22 changes: 15 additions & 7 deletions java-import.el → javadoc-import.el
@@ -1,10 +1,10 @@
;;; java-import.el --- quickly add import statements in Java
;;; javadoc-import.el --- quickly add import statements in Java

;; This is free and unencumbered software released into the public domain.

;;; Commentary:

;; Provides the functions `add-java-import' and `sort-java-imports'.
;; Provides the functions `javadoc-add-import' and `javadoc-sort-imports'.

;;; Code:

Expand Down Expand Up @@ -44,15 +44,19 @@
(point))

;;;###autoload
(defun sort-java-imports ()
(defun javadoc-sort-imports ()
"Sort the imports in the import section in proper order."
(interactive)
(when (jdl/has-import)
(save-excursion
(sort-lines nil (jdl/goto-first-import) (jdl/goto-last-import)))))

;;;###autoload
(defun add-java-import ()
(define-obsolete-function-alias
'sort-java-imports 'javadoc-sort-imports "1.1.0")

;;;###autoload
(defun javadoc-add-import ()
"Insert an import statement at import section at the top of the file."
(interactive)
(let ((class (jdl/completing-read)))
Expand All @@ -61,7 +65,7 @@
(progn
(jdl/goto-first-import)
(insert "import " class ";\n")
(sort-java-imports))
(javadoc-sort-imports))
(progn
(goto-char (point-min))
(when (jdl/in-package)
Expand All @@ -71,6 +75,10 @@
(insert "\n"))
(insert "import " class ";\n"))))))

(provide 'java-import)
;;;###autoload
(define-obsolete-function-alias
'add-java-import 'javadoc-add-import "1.1.0")

(provide 'javadoc-import)

;;; java-import.el ends here
;;; javadoc-import.el ends here
6 changes: 3 additions & 3 deletions javadoc-lookup.el
Expand Up @@ -2,17 +2,17 @@

;; This is free and unencumbered software released into the public domain.

;; Author: Christopher Wellons <mosquitopsu@gmail.com>
;; Author: Christopher Wellons <wellons@nullprogram.com>
;; URL: https://github.com/skeeto/javadoc-lookup
;; Version: 1.0.0
;; Version: 1.0.1
;; Package-Requires: ((cl-lib "0.3"))

;;; Commentary:

;; This package provides a quick way to look up any Javadoc
;; documentation from Emacs, using your browser to display the
;; information. Since the mechanism is already there, java-import.el
;; provides the completing function `add-java-import' for quickly
;; provides the completing function `javadoc-add-import' for quickly
;; adding an import to a source file.

;; This mode stores database and index information in
Expand Down
6 changes: 3 additions & 3 deletions maven-fetch.el
Expand Up @@ -22,7 +22,7 @@

;;; Code:

(require 'cl)
(require 'cl-lib)
(require 'javadoc-lookup)

(defcustom maven-program-name "mvn"
Expand All @@ -47,7 +47,7 @@
(expand-file-name (format "%s/%s" (elt artifact 0) (elt artifact 1))
(jdl/dir-truename javadoc-lookup-cache-dir)))

(defun* maven-fetch (artifact)
(cl-defun maven-fetch (artifact)
"Use maven to fetch ARTIFACT into the cache directory,
returning true on success."
(let ((jarfile (maven-fetch-artifact-jar artifact)))
Expand All @@ -60,7 +60,7 @@ returning true on success."
maven-fetch-command
(format "-Ddest=%s" jarfile)
(apply #'format artifact-arg
(coerce artifact 'list))))))))
(cl-coerce artifact 'list))))))))

(defun maven-fetch-unpack (artifact)
"Unpack an artifact in the javadoc-lookup cache directory,
Expand Down

0 comments on commit aacf9ad

Please sign in to comment.