Skip to content

Commit

Permalink
Prefer project-root in favor of project-roots (#105)
Browse files Browse the repository at this point in the history
The latter has been deprecated.

If project-root is not bound, use project-roots like before.
  • Loading branch information
jobor committed Feb 1, 2023
1 parent 14d4c6a commit aca92ec
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions rg.el
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,13 @@ DEFAULT is the default pattern to use at the prompt."
(fboundp 'ffip-project-root))
(ffip-project-root))
(when (and (require 'project nil t)
(fboundp 'project-current)
(fboundp 'project-roots))
(let ((project (project-current)))
(when project
(car (project-roots project)))))
(fboundp 'project-current))
(if-let ((project (project-current)))
(cond
((fboundp 'project-root)
(project-root project))
((fboundp 'project-roots)
(car (project-roots project))))))
(let ((file (expand-file-name (or file default-directory))))
(condition-case nil
(vc-call-backend (vc-responsible-backend file) 'root file)
Expand Down

0 comments on commit aca92ec

Please sign in to comment.