• 0 Posts
  • 5 Comments
Joined 1 year ago
cake
Cake day: October 3rd, 2023

help-circle



  • I guess given that I see file metadata in marginalia correctly, project-find-file-in does call find-file with appropriate dynamic binding for default-directory, so I suspect the way embark works (or due to other stuffs, perhaps /u/oantolin can explain), it cannot continue from that scope, so by the time embark starts the old dynamic scope has already been unwound?

    Anyway, you can just wrap that function call with your own binding that covers embark:

    (defun find-file-in-project (&optional dir)
      (interactive)
      (when-let* ((project (project-current nil dir))
                  (default-directory (project-root project)))
        (project-find-file-in nil nil project)))