Skip to content

Commit

Permalink
Fix projectile-recentf with inactive project (#1881)
Browse files Browse the repository at this point in the history
projectile-recentf-files expands recentf files to use canonicalized
versions, /home/example/project instead of ~/project. However, if the
project is not active and projectile-recentf was called, it would return
non-canonicalized directory which then fails the comparison with recentf
list.
  • Loading branch information
gessen authored and bbatsov committed Feb 11, 2024
1 parent ec4cb8d commit 375a63b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
* [#1877](https://github.com/bbatsov/projectile/pull/1877): Add custom variable `projectile-cmd-hist-ignoredups`.
* Add support for Eask projects.

### Bugs fixed

* [#1881](https://github.com/bbatsov/projectile/issues/1881): Fix projectile-recentf when called outside any project

## 2.8.0 (2023-10-13)

### New features
Expand Down
2 changes: 1 addition & 1 deletion projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -4933,7 +4933,7 @@ directory to open."
(defun projectile-recentf-files ()
"Return a list of recently visited files in a project."
(and (boundp 'recentf-list)
(let ((project-root (projectile-acquire-root)))
(let ((project-root (expand-file-name (projectile-acquire-root))))
(mapcar
(lambda (f) (file-relative-name f project-root))
(cl-remove-if-not
Expand Down

0 comments on commit 375a63b

Please sign in to comment.