branch: externals/counsel
commit 49c749515d44395c06715aba0f98fcde3fd87d92
Author: Basil L. Contovounesios <[email protected]>
Commit: Basil L. Contovounesios <[email protected]>

    Fix usage of project-current
    
    * counsel.el (counsel--project-current): Handle project instances as
    opaque values.
    
    Closes #3003.
    Fixes #3041.
---
 counsel.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/counsel.el b/counsel.el
index 493bb7df27..32965cb66d 100644
--- a/counsel.el
+++ b/counsel.el
@@ -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.

Reply via email to