emacs-devel
[Top][All Lists]
Advanced

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

Re: running EDE from a file that is not under a project root dir


From: Stephen Leake
Subject: Re: running EDE from a file that is not under a project root dir
Date: Wed, 05 Aug 2015 02:48:00 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

Dmitry Gutov <address@hidden> writes:

> On 08/04/2015 09:13 PM, Stephen Leake wrote:
>
>> But then it uses semantic-symref-derive-find-filepatterns to get the
>> file patterns to pass to grep. Since I'm starting from a text-mode
>> buffer, that returns (*.letter *.article *.te?xt). Which is _not_ what I
>> want; I want *.el.
>
> If we don't want to change too much code, I suppose
> xref-collect-references could bind semantic-symref-filepattern-alist
> to a list of one element:
>
> `((,major-mode "*"))
>
> Though that will search in all files. To refine it further, indeed we
> could make the choice based on what the project tells us.
>
>> My question is this; what is the minimum change I should make to EDE to
>> support these use cases?
>>
>> I think I need three things:
>>
>> - add a "file patterns" element to the EDE project (or target?) data
>> structure, and have semantic-symref-derive-find-filepatterns check that
>> before the alists.
>
> That's cool, but won't help xref-find-references if EDE isn't used. 

Right; I'm exploring using an EDE elisp project via the project.el API.

I'm also implementing a separate elisp project that supports only the
project.el API.

> On the other hand, if we introduce project-source-file-patterns,
> xref-find-references could use it in the
> semantic-symref-filepattern-alist binding.

Yes, I think that would be appropriate.

> And ede-source-file-patterns 

That's not a currently defined function. Did you mean
project-source-file-patterns? Or are you agreeing with me that EDE needs
to add this?

> could be used by semantic-symref-symbol and semantic-symref-regexp.
>
> That issue aside, xref-find-references currently doesn't use
> project-ignores, 

Right; it should.

> nor does it use grep-find-ignored-directories and
> grep-find-ignored-files. 

It should not use these directly; only via project-ignores.

>> - add an ede-global-project variable that I can set to my current
>> project, to bypass the project root detection.
>>
>>      I've proposed the same change to project.el; there, it can be used
>>      by one of the project-find functions.
>
> project.el doesn't need that variable. The variable can just as well
> live in the package you're writing.

I don't understand. Surely the concept "a project that is active in all
buffers" is independent of the actual project type?

I will want it for elisp, Ada, Java, ...

If it's not in project.el, I'll have to add it to every new project type
I write; that will be a name conflict, at the very least.

-- 
-- Stephe



reply via email to

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