Skip to content

Commit

Permalink
Fix usage of project-current
Browse files Browse the repository at this point in the history
* counsel.el (counsel--project-current): Handle project instances as
opaque values.

Closes #3003.
Fixes #3041.
  • Loading branch information
basil-conto committed Apr 13, 2024
1 parent 871091d commit 49c7495
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions counsel.el
Original file line number Diff line number Diff line change
Expand Up @@ -6432,8 +6432,12 @@ Use `projectile-project-root' to determine the root."
(defun counsel--project-current ()
"Return root of current project or nil on failure.
Use `project-current' to determine the root."
(and (fboundp 'project-current)
(cdr (project-current))))
(let ((proj (and (fboundp 'project-current)
(project-current))))
(cond ((fboundp 'project-root)
(project-root proj))
((fboundp 'project-roots)
(car (project-roots proj))))))

(defun counsel--configure-root ()
"Return root of current project or nil on failure.
Expand Down

0 comments on commit 49c7495

Please sign in to comment.