[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master d879c40f68c: * etc/NEWS: Mention it.
From: |
Eshel Yaron |
Subject: |
Re: master d879c40f68c: * etc/NEWS: Mention it. |
Date: |
Mon, 09 Sep 2024 19:52:54 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Spencer Baugh <sbaugh@janestreet.com> writes:
> 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 <dmitry@gutov.dev> 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))
Great, now done in 466db358772.
Thanks,
Eshel