I'm fine with this change. "Find file in root: " seems like it would be a decent prompt. On Mon, Sep 9, 2024 at 7:40 AM Dmitry Gutov wrote: > On 09/09/2024 11:42, Eshel Yaron wrote: > > Nitpick: I find the use of call-interactively with a constant argument > > slightly awkward. What do y'all think about a revision along the > > following lines? > > Yeah, I think that works too (the only real duplication is the call to > confirm-nonexistent-file-or-buffer, that's minor). > > > --8<---------------cut here---------------start------------->8--- > > ;;;###autoload > > (defun project-find-file-in-root (filename) > > "Edit file FILENAME. > > Interactively, prompt for FILENAME, defaulting to the root directory of > > the current project." > > (declare (interactive-only find-file)) > > (interactive > > (list (read-file-name "Find project file: " > > Maybe "Find in root: "? The command variant doesn't necessarily show all > project files, or only project files. > > > (project-root (project-current t)) nil > > (confirm-nonexistent-file-or-buffer)))) > > (find-file filename t)) > >