From 375a63bf55f52e6542bbf395b526698028f56d88 Mon Sep 17 00:00:00 2001 From: Jacek Swierk Date: Sun, 11 Feb 2024 19:48:59 +0100 Subject: [PATCH] Fix projectile-recentf with inactive project (#1881) 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. --- CHANGELOG.md | 4 ++++ projectile.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1013fc22d..edc452657 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/projectile.el b/projectile.el index d422632a4..208fb9358 100644 --- a/projectile.el +++ b/projectile.el @@ -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