summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2018-08-25 10:46:05 +0200
committerBozhidar Batsov <bozhidar@batsov.com>2018-08-25 10:46:05 +0200
commit4d226ffee8459f7590ccfacf2dd4ef2ac695ccac (patch)
treeff7e7a47895a2b40ea482d52293ffd5e64390a66
parent396786c30b6b69d0337899150662d96d3be1fd86 (diff)
[Fix #2427] Handle properly multiple project types
There were two problems fixed in this commit: * `default` has to be a string for completing-read to work * completing-read returns a string, but we need a symbol
-rw-r--r--cider.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/cider.el b/cider.el
index b8647c00..dba86d94 100644
--- a/cider.el
+++ b/cider.el
@@ -1363,7 +1363,8 @@ tool in `cider-preferred-build-tool', otherwise prompt the user to choose.
PROJECT-DIR defaults to the current project."
(let* ((choices (cider--identify-buildtools-present project-dir))
(multiple-project-choices (> (length choices) 1))
- (default (car choices))
+ ;; this needs to be a string to be used in `completing-read'
+ (default (symbol-name (car choices)))
;; `cider-preferred-build-tool' used to be a string prior to CIDER
;; 0.18, therefore the need for `cider-maybe-intern'
(preferred-build-tool (cider-maybe-intern cider-preferred-build-tool)))
@@ -1371,8 +1372,10 @@ PROJECT-DIR defaults to the current project."
(member preferred-build-tool choices))
preferred-build-tool)
(multiple-project-choices
- (completing-read (format "Which command should be used (default %s): " default)
- choices nil t nil nil default))
+ (intern
+ (completing-read
+ (format "Which command should be used (default %s): " default)
+ choices nil t nil nil default)))
(choices
(car choices))
;; TODO: Move this fallback outside the project-type check