emacs-devel
[Top][All Lists]
Advanced

[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 10:42:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi,

Dmitry Gutov <dgutov@yandex.ru> writes:

> branch: master
> commit d879c40f68c078bdba15122e4e886a2052fbddf4

[...]

> +;;;###autoload
> +(defun project-find-file-in-root ()
> +  "..."
> +  (interactive)
> +  (let* ((pr (project-current t))
> +         (default-directory (project-root pr)))
> +    (call-interactively #'find-file)))

Nice addition, thanks!

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?

--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: "
                         (project-root (project-current t)) nil
                         (confirm-nonexistent-file-or-buffer))))
  (find-file filename t))
--8<---------------cut here---------------end--------------->8---




reply via email to

[Prev in Thread] Current Thread [Next in Thread]