emacs-devel
[Top][All Lists]
Advanced

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

Re: Unified project interface


From: Stephen Leake
Subject: Re: Unified project interface
Date: Fri, 05 Jun 2015 08:03:24 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

Stephen Leake <address@hidden> writes:

> Dmitry Gutov <address@hidden> writes:
>
>> On 06/04/2015 05:40 PM, Stephen Leake wrote:
>>
>>> The list of directories that xref-find-regexp needs to search is not
>>> the project root; it is the list of directories included by the project
>>> source code.
>>
>> Not exactly. xref-find-regexp is interested in all kinds of files, not
>> just source files. That includes, say, the README file at the top of
>> the project.
>
> No problem; make sure that directory is in project-source-directories.
>
> README is a perfectly valid source file; it is written in the "plain
> text" language (for which no compiler is needed ;).
>
> I have no problem with projects including more than one language in the
> sources; most of mine have Ada, Texinfo, LaTeX, text, elisp, and make
> source code. Which is one reason why project and xref cannot be merged
> (xref must be language-specific, even for tags).
>
> It might make sense to parameterize project-source-directories
> with a language (or major-mode) name, to get the corresponding subset.

There are a couple of use cases here that require different functions:

1) You are editing a LaTeX file containing documentation for a Python
module implemented in Python and C++. You want to find all mentions/references
related to feature "foo", in LaTeX, Python, and C++ source files. So you
invoke project-find-regexp, which searches for *.tex, *.py, *.hhp, *.cpp
in project-source-directories.

2) You are refactoring a C++ function foo::bar, and want to find all
references to bar* for comparison. You invoke xref-find-regexp, which
searches xref-source-directories.

There are a couple of implementation options here:

- implement project-source-directories as the union of
  xref-source-directories for all backends listed in a project file

- implement xref-source-directories as a subset of
  project-source-directories for each backend.

I'm inclined to the latter; it's closer to what ada-mode does now.

-- 
-- Stephe



reply via email to

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