阅读了project-find-file
的源码之后,我发现实现这个行为只需要更改find-file
函数
(defun mk/project-read-file-name ()
(let ((find-file-advice (lambda (file-name) file-name))
res)
(advice-add 'find-file :override find-file-advice)
(setq res (project-find-file t))
(advice-remove 'find-file find-file-advice)
res))