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: Stephen Leake
Subject: Re: make project--find-in-file generic, add interactive filename to project-find-file
Date: Thu, 28 Jan 2016 05:11:48 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

Stephen Leake <address@hidden> writes:

> Stephen Leake <address@hidden> writes:
>
>> Dmitry Gutov <address@hidden> writes:
>>
>>> On 01/28/2016 04:04 AM, Stephen Leake wrote:
>>>> Any objections to the attached patch?
>>>
>>
>>> - 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.
>>
>> So instead of computing `table' in project--find-file-in, it would
>> call (project--file-completion-table dirs project). The default
>> implementation of `project--file-completion-table' would be the code
>> using `find-program'.
>>
>> I'll give that a try.
>
> That works nicely; new patch attached.

One change; if there is no filename at point, don't include "(nil)" in
the prompt:

(defun project--find-file-in (filename dirs project)
  "Complete FILENAME in DIRS in PROJECT, visit the file."
  (find-file
   (completing-read
    (if filename
        (format "Find file (%s): " filename)
      "Find file: ")
    (project--file-completion-table project dirs)
    nil t nil nil filename)))

-- 
-- Stephe



reply via email to

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