Refactor Project API to reflect changes upstream
projectile-project-root no longer returns `default-directory` if not in a project (it returns nil). As such, doom-project-* functions (and their uses) have been refactored. + doom-project-p & doom-project-root are aliases for projectile-project-p & projectile-project-root. + doom-project-{p,root,name,expand} now has a DIR argument (for consistency, since projectile-project-name and projectile-project-expand do not). + The nocache parameter is no longer necessary, as projectile's caching behavior is now more sane. + Removed some projectile advice/hacks that are no longer necessary. + Updated unit tests
This commit is contained in:
parent
3961ba1662
commit
53fe7a1f04
22 changed files with 53 additions and 84 deletions
|
@ -88,8 +88,8 @@ MATCH is a string regexp. Only entries that match it will be included."
|
|||
(recentf-add-file new-path))
|
||||
(recentf-remove-if-non-kept old-path))
|
||||
(when (and (bound-and-true-p projectile-mode)
|
||||
(projectile-project-p)
|
||||
(projectile-file-cached-p old-path (doom-project-root 'nocache)))
|
||||
(doom-project-p)
|
||||
(projectile-file-cached-p old-path (doom-project-root)))
|
||||
(projectile-purge-file-from-cache old-path))
|
||||
(when (bound-and-true-p save-place-mode)
|
||||
(save-place-forget-unreadable-files)))
|
||||
|
@ -111,7 +111,7 @@ MATCH is a string regexp. Only entries that match it will be included."
|
|||
(list new-path))))
|
||||
(new-path-dir (file-name-directory new-path))
|
||||
(project-root (doom-project-root))
|
||||
(short-new-name (if (file-in-directory-p new-path project-root)
|
||||
(short-new-name (if (and project-root (file-in-directory-p new-path project-root))
|
||||
(file-relative-name new-path project-root)
|
||||
(abbreviate-file-name new-path))))
|
||||
(unless (file-directory-p new-path-dir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue