Skip to content
Browse files

unified completion mechanism

  • Loading branch information...
1 parent c85df50 commit af11c52253c3752ffb9483a16e7a5cbec158d41f @senny committed Oct 29, 2009
Showing with 10 additions and 15 deletions.
  1. +1 −1 eclim-ant.el
  2. +3 −3 eclim-java.el
  3. +1 −1 eclim-maven.el
  4. +2 −2 eclim-project.el
  5. +3 −8 eclim.el
View
2 eclim-ant.el
@@ -61,7 +61,7 @@ stored. It is used globally for all eclim projects."
(puthash buildfile (eclim/ant-target-list project buildfile) eclim--ant-target-cache)))
(defun eclim--ant-read-target (project buildfile)
- (ido-completing-read "Target: " (eclim--ant-targets project buildfile)))
+ (eclim--completing-read "Target: " (eclim--ant-targets project buildfile)))
(defun eclim/ant-validate (project buildfile)
(eclim--check-project project)
View
6 eclim-java.el
@@ -380,7 +380,7 @@ a java type that can be imported."
(let* ((pattern (cdr (eclim--java-identifier-at-point)))
(imports (eclim/java-import (eclim--project-name) pattern)))
(eclim--java-organize-imports (eclim/java-import-order (eclim--project-name))
- (list (eclim--choices-prompt "Import" imports)))))
+ (list (eclim--completing-read "Import: " imports)))))
(defun eclim-java-import-missing ()
"Checks the current file for missing imports and prompts the
@@ -397,7 +397,7 @@ user if necessary."
(eclim--java-organize-imports imports-order
(if (= len 1) candidates
(list
- (eclim--choices-prompt (concat "Missing type '" (cdr (assoc 'type unused)) "'")
+ (eclim--completing-read (concat "Missing type '" (cdr (assoc 'type unused)) "'")
candidates)))))))))
(defun eclim-java-remove-unused-imports ()
@@ -417,7 +417,7 @@ user if necessary."
(let* ((response (eclim/java-impl (eclim--project-name) (eclim--project-current-file)))
(methods (remove-if-not (lambda (element) (string-match "(.*)" element))
response)))
- (insert (ido-completing-read "Signature: " methods) " {}")
+ (insert (eclim--completing-read "Signature: " methods) " {}")
(backward-char)))
View
2 eclim-maven.el
@@ -40,7 +40,7 @@
'("validate" "compile" "test" "package" "integration" "verify" "install" "deploy"))
(defun eclim--maven-lifecycle-phase-read ()
- (ido-completing-read "Phase: " eclim-maven-lifecycle-phases))
+ (completing-read "Phase: " eclim-maven-lifecycle-phases))
(defun eclim--maven-pom-path ()
(concat (eclim--project-dir) "/pom.xml "))
View
4 eclim-project.el
@@ -75,7 +75,7 @@
(progn
(or (if single nil (eclim--project-get-marked))
(eclim--project-current-line)))
- (ido-completing-read "Project: "
+ (eclim--completing-read "Project: "
(mapcar (lambda (row) (nth 2 row)) (eclim/project-list)))))
(defun eclim--project-mode-init ()
@@ -267,7 +267,7 @@
(eclim--project-buffer-refresh))
(defun eclim--project-nature-read ()
- (ido-completing-read "Type: " (eclim/project-nature-aliases)))
+ (completing-read "Type: " (eclim/project-nature-aliases)))
(defun eclim-project-mode-refresh ()
(interactive)
View
11 eclim.el
@@ -46,8 +46,9 @@
(file-exists-p (setq file (expand-file-name "bin/eclim" file)))
(return file)))))
-(defcustom eclim-interactive-completion-function 'ido-completing-read
- ""
+(defcustom eclim-interactive-completion-function (if ido-mode 'ido-completing-read 'completing-read)
+ "Defines a function which is used by eclim to complete a list of
+choices interactively."
:group 'eclim
:type 'function)
@@ -264,12 +265,6 @@ saved."
(interactive)
;; TODO display the errors in a formatted list
(message (eclim/problems (eclim--project-name))))
-
-(defun eclim--choices-prompt (prompt choices)
- "Displays a prompt and lets the user choose between a list of choices."
- (or
- (ido-completing-read (concat prompt ": ") choices)
- ""))
(defun eclim-complete ()
(interactive)

0 comments on commit af11c52

Please sign in to comment.
Something went wrong with that request. Please try again.