Skip to content

Commit 4d226ff

Browse files
committed
[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
1 parent 396786c commit 4d226ff

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cider.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,16 +1363,19 @@ tool in `cider-preferred-build-tool', otherwise prompt the user to choose.
13631363
PROJECT-DIR defaults to the current project."
13641364
(let* ((choices (cider--identify-buildtools-present project-dir))
13651365
(multiple-project-choices (> (length choices) 1))
1366-
(default (car choices))
1366+
;; this needs to be a string to be used in `completing-read'
1367+
(default (symbol-name (car choices)))
13671368
;; `cider-preferred-build-tool' used to be a string prior to CIDER
13681369
;; 0.18, therefore the need for `cider-maybe-intern'
13691370
(preferred-build-tool (cider-maybe-intern cider-preferred-build-tool)))
13701371
(cond ((and multiple-project-choices
13711372
(member preferred-build-tool choices))
13721373
preferred-build-tool)
13731374
(multiple-project-choices
1374-
(completing-read (format "Which command should be used (default %s): " default)
1375-
choices nil t nil nil default))
1375+
(intern
1376+
(completing-read
1377+
(format "Which command should be used (default %s): " default)
1378+
choices nil t nil nil default)))
13761379
(choices
13771380
(car choices))
13781381
;; TODO: Move this fallback outside the project-type check

0 commit comments

Comments
 (0)