emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make project--find-in-file generic, add interactive filename to proj


From: Dmitry Gutov
Subject: Re: make project--find-in-file generic, add interactive filename to project-find-file
Date: Thu, 28 Jan 2016 12:21:44 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Thunderbird/44.0

On 01/28/2016 04:04 AM, Stephen Leake wrote:
Any objections to the attached patch?

A couple:

- IIRC, using INITIAL-INPUT argument is semi-deprecated. Using DEFAULT is preferable, and then you don't need to make that value depend on current-prefix-arg. We can always set the default input, and if the user wants to use it, they will press M-n. And I see no good reason to thread it through the command's function arguments. Why not do it like in the patch at the bottom?

- More importantly, the new generic function should not do too much. It should return a completion table, which can dispatch to ede, ada-mode, or any other facility. I believe we've went over this a couple of times already.

The xref docstring looks good, thanks.

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 85f3907..03ead98 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -357,7 +357,8 @@ project--find-file-in
                    (t
(complete-with-action action all-files string pred))))))
     (find-file
-     (completing-read "Find file: " table nil t))))
+     (completing-read "Find file: " table nil t nil nil
+                      (thing-at-point 'filename)))))

 (provide 'project)
 ;;; project.el ends here





reply via email to

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