From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel@gnu.org
Subject: Re: Unified project interface
Date: Fri, 05 Jun 2015 05:08:49 -0500 [thread overview]
Message-ID: <85iob2a2mm.fsf@stephe-leake.org> (raw)
In-Reply-To: <5570E86B.8070200@yandex.ru> (Dmitry Gutov's message of "Fri, 5 Jun 2015 03:08:11 +0300")
Dmitry Gutov <dgutov@yandex.ru> 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.
>> For that you need a function like "project-source-directories", which
>> could be customized for each project backend.
>
> However, you raise an interesting point. Whereas xref-find-references
> would like to search in all load-path directories,
'load-path' is an elisp notion. For other languages "source-path" is
more appropriate.
> maybe it would be enough if xref-find-regexp only searches inside the
> current "project root", for some definition of that notion.
No, xref-find-regexp should search project-source-directories.
Most real projects include other projects, so limiting the search to
only the top project is wrong in general (although that might be a
useful option in some use cases).
In addition, there might be a directory under project root that should
_not_ be searched; the object file directory for ada-mode, for example.
project-source-directories should return the union of the source
directories for all of the included projects. That's what load-path is
for elisp, and what compilation-search-path is for ada-mode and other
language modes.
For elisp, project-source-directories should simply return load-path.
> I wonder how we could make it work this way. Make "project root" an
> orthogonal feature?
If you mean "orthogonal to source directories", then yes, that is what I
am suggesting.
>> The ada-mode project file can be anywhere; in my projects, it is usually
>> _not_ at the "project root directory", but down one or two layers in
>> build/ or build/release/.
>
> We can't rely on every Elisp project declaring a "project root" in the
> same way, though.
We can make it a requirement in order to use the general tool. But first
we have to justify it; ada-mode has never needed that notion; neither
has elisp. In my experience, only config management needs it.
>> Hmm - vc could query for the current project root, and ada-mode would
>> provide the answer. That might be useful, and a good reason to have a
>> unified project interface.
>
> VC is one option for this. Or the project may be not registered in any
> VCS yet, and the root would be determined based on, say, the presence
> of configure.ac. Again, this suggests that notions of "source
> directories" and "project root" can be somewhat orthogonal.
Not just "somewhat"; "completely" :).
It also points out that "project root" is poorly defined; I think that
is because it's not at all clear when and why we need it.
> On the other hand, after the project root is determined, it might want
> to add some new element(s) to the source directories list.
"it" is what here ? Can you give an example?
>> There are lots of project meta-data that the ada-mode project file syntax
>> provides; compiler options, object directory, case exceptions, etc. Some
>> of those might be common with other projects.
>
> Right. We'll need those pieces of metadata that are useful to more
> than one subsystem, and can be employed in a general way. Though a
> generic metadata storage might be useful as well: thus, if some minor
> mode has read the project file and parsed the compiler options, it can
> set the related metadata, so that code completion and linter could use
> it without waiting for Emacs core to standardize it.
ada-mode uses a plist to represent the project metadata, and has examples
of minor modes adding to the plist.
--
-- Stephe
next prev parent reply other threads:[~2015-06-05 10:08 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 11:43 Unified project interface Dmitry Gutov
2015-06-04 14:40 ` Stephen Leake
2015-06-05 0:08 ` Dmitry Gutov
2015-06-05 10:08 ` Stephen Leake [this message]
2015-06-05 13:03 ` Stephen Leake
2015-06-05 13:14 ` Dmitry Gutov
2015-06-08 1:24 ` Stephen Leake
2015-06-09 18:16 ` Dmitry Gutov
2015-06-09 18:21 ` Eli Zaretskii
2015-06-09 18:49 ` Dmitry Gutov
2015-06-09 19:03 ` Eli Zaretskii
2015-06-07 23:22 ` Dmitry Gutov
2015-06-08 1:35 ` [SPAM UNSURE] " Stephen Leake
2015-06-09 19:04 ` Dmitry Gutov
2015-06-07 23:15 ` Dmitry Gutov
2015-06-08 1:59 ` Stephen Leake
2015-06-09 22:31 ` Dmitry Gutov
2015-06-10 7:13 ` Steinar Bang
2015-07-08 0:25 ` Dmitry Gutov
2015-07-11 13:43 ` Bozhidar Batsov
2015-07-11 14:17 ` Dmitry Gutov
2015-07-12 14:42 ` Dmitry Gutov
2015-07-13 8:49 ` Bozhidar Batsov
2015-07-13 10:23 ` Dmitry Gutov
2015-07-24 23:43 ` Dmitry Gutov
2015-07-25 0:55 ` Stephen Leake
2015-07-25 7:29 ` Eli Zaretskii
2015-07-26 2:12 ` Dmitry Gutov
2015-07-26 2:45 ` Eli Zaretskii
2015-07-26 11:25 ` Stephen Leake
2015-07-26 2:11 ` Dmitry Gutov
2015-07-26 11:22 ` Stephen Leake
2015-07-26 17:23 ` Dmitry Gutov
2015-07-26 18:57 ` Stephen Leake
2015-07-26 23:56 ` John Yates
2015-07-27 1:49 ` Dmitry Gutov
2015-07-27 11:12 ` Stephen Leake
2015-07-27 11:27 ` Dmitry Gutov
2015-07-27 13:00 ` Dmitry Gutov
2015-07-27 13:02 ` Dmitry Gutov
2015-07-28 1:21 ` Stephen Leake
2015-07-28 11:05 ` Stephen Leake
2015-07-28 14:33 ` Dmitry Gutov
2015-07-28 15:45 ` Stephen Leake
2015-07-28 16:25 ` Dmitry Gutov
2015-07-29 1:36 ` Stephen Leake
2015-07-29 2:10 ` Dmitry Gutov
2015-07-28 14:18 ` Dmitry Gutov
2015-07-28 16:15 ` Stephen Leake
2015-07-28 18:44 ` Dmitry Gutov
2015-07-29 2:27 ` Stephen Leake
2015-07-29 22:51 ` Dmitry Gutov
2015-07-30 8:17 ` Stephen Leake
2015-07-31 0:15 ` Dmitry Gutov
2015-07-31 16:13 ` Stephen Leake
2015-08-01 0:57 ` Dmitry Gutov
2015-08-01 9:50 ` Stephen Leake
2015-08-01 10:51 ` Stephen Leake
2015-08-01 12:42 ` Dmitry Gutov
2015-08-01 12:40 ` Dmitry Gutov
2015-08-01 14:15 ` Stephen Leake
2015-08-01 15:09 ` Dmitry Gutov
2015-08-01 19:04 ` Stephen Leake
2015-08-01 22:33 ` Dmitry Gutov
2015-08-01 1:14 ` Per-language project-search-path, was: " Dmitry Gutov
2015-08-01 10:43 ` Stephen Leake
2015-08-01 14:12 ` Dmitry Gutov
2015-08-01 18:57 ` Stephen Leake
2015-08-02 0:25 ` Dmitry Gutov
2015-08-02 2:29 ` Eric Ludlam
2015-08-02 8:57 ` Nix
2015-08-02 17:14 ` Michael Heerdegen
2015-08-02 23:09 ` Eric Ludlam
2015-08-02 23:39 ` Michael Heerdegen
2015-08-03 11:33 ` Eric Ludlam
2015-08-02 23:07 ` Dmitry Gutov
2015-08-03 10:24 ` Nix
2015-08-03 10:35 ` Dmitry Gutov
2015-08-07 15:25 ` Nix
2015-08-03 1:21 ` Dmitry Gutov
2015-07-29 23:11 ` xref display and multiple locations, " Dmitry Gutov
2015-06-06 10:20 ` Bozhidar Batsov
2015-06-06 10:29 ` Dmitry Gutov
2015-06-06 12:32 ` Eric Ludlam
2015-06-06 18:44 ` Dmitry Gutov
2015-06-06 19:28 ` Eli Zaretskii
2015-06-07 22:29 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85iob2a2mm.fsf@stephe-leake.org \
--to=stephen_leake@stephe-leake.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.