about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2024-10-02 13:08:08 +0100
committerDavid Morgan <djm_uk@protonmail.com>2024-10-02 13:08:08 +0100
commitfc4fca82c97c01e99b9573c3fb88e76306045ce2 (patch)
tree0f1a4baa82bad77c5f28c0b13b6baf3b58c5a915
parentd7578c0df016fe8f797e260208e10742ec84aeae (diff)
downloaddotfiles-fc4fca82c97c01e99b9573c3fb88e76306045ce2.tar.gz
Fix project-recentf
-rw-r--r--.emacs.d/lisp/init-project.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/.emacs.d/lisp/init-project.el b/.emacs.d/lisp/init-project.el
index 6387f05..d2c7ca7 100644
--- a/.emacs.d/lisp/init-project.el
+++ b/.emacs.d/lisp/init-project.el
@@ -28,14 +28,18 @@
     "Show a list of recently visited files in a project."
     (interactive)
     (if (boundp 'recentf-list)
+        ;; Use expand-file-name for project-root and later recentf-list to ensure consistency
         (let* ((project-root (expand-file-name (project-root (project-current))))
                (project-recentf-files (mapcar
                                        (lambda (f) (file-relative-name f project-root))
-                                       (seq-filter (apply-partially 'string-prefix-p project-root) recentf-list))))
+                                       (seq-filter (apply-partially 'string-prefix-p project-root)
+                                                   (mapcar 'expand-file-name recentf-list)))))
           (find-file (expand-file-name
                       (funcall project-read-file-name-function
                                "Find recent project files"
-                               project-recentf-files)
+                               project-recentf-files
+                               nil
+                               'file-name-history)
                       project-root)))
       (message "recentf is not enabled")))
   (defun project-switch-src-project ()