unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Stephen Leake <stephen_leake@stephe-leake.org>
Cc: John Wiegley <jwiegley@gmail.com>, emacs-devel@gnu.org
Subject: Re: project.el semantics
Date: Wed, 11 Nov 2015 15:21:32 +0200	[thread overview]
Message-ID: <564340DC.5020008@yandex.ru> (raw)
In-Reply-To: <86r3jw4yrf.fsf@stephe-leake.org>

On 11/11/2015 12:27 PM, Stephen Leake wrote:

> My point is you don't have a good use case for "library", either. At
> least, the use case for "search only on libraries" is no more important
> than other similar "search only on ..." use cases.

You can't say I don't have a use case when I do use it. Just take it on 
faith.

"search only on libraries" doesn't seems particularly important, but 
"search in project only" and "in project + libraries" are.

>> How would they provide the predicate when calling the command
>> interactively? Especially a predicate that would distinguish between
>> project roots and library roots.
>
> In a lot of cases, they will simply search the entire directory list,
> and filter the results manually as they go thru them.

That's not an answer to the question.

> But they can take the time to write a predicate function, and invoke the
> command via M-; to supply it as an argument in the call.

That's not how we usually imagine a user interface.

> Or they could write a wrapper that provides a list of common predicates.

A user, conceivably, could. Because they probably know the layout of a 
given project; even though they might have to create a new wrapper for 
each project, or a kind of project, they work on.

But third-party code that might use project.el, doesn't know anything 
about the project, except what project.el tells it.

> In general, project.el is not about the final user interface, it is
> about providing core functionality.

Providing core functionality for third-party code that's not, usually, 
written by the user either. So it's exactly the business of project.el 
to include the kind of metadata like "these are the directories the user 
might be interested in, but the user doesn't own the code inside".

> Since project-roots is treated recursively, "not included in" means (not
> (file-in-directory-p ...)) to me.

Not to me. We need a third opinion here. I might be biased, of course:

http://apidock.com/ruby/v1_9_3_392/Enumerable/include%3F

>> And "not member" semantics seems pointless to me here; we might as
>> well allow project-library-roots to include project-roots element, if
>> the consumer will have to call `project-combine-directories' on them
>> together.
>
> I'm confused. With the current definitions, project-roots and
> project-library-roots are disjoint, so the user does have to call
> project-combine-directories if they want to search on both.

Why are you confused? Look at the definitions: they use `append'.

> You now seem to be agreeing with me; it would be better to have only
> one project-roots function.

Nope.

>> Having "library roots" entirely outside the project roots, however,
>> makes a lot of sense to me intuitively: if they're inside, they are a
>> part of the project anyway. What kind of use would we have for such
>> elements?
>
> I'm not sure what you are asking here.

I was continuing the line of thought that started with the assumption 
that you want the (not (member ...)) semantics.

> You seem to be asking "why would we want to search on
> project-library-roots".

No.

>> Would you be able to give an example of a project file that lists
>> dependencies like that, that "should be edited together" with the
>> current project? It would fit the manual well.
>
> We have not defined an Emacs project file yet. I can easily provide an
> Ada example, but I don't think you want that actual file in the Emacs
> manual.

Not the contents of the file, of course. I just want to construct a 
realistic-sounding sentence, maybe mentioning Maven modules or whatever.

> Any case where a large project is divided into subprojects, all of which
> are editable. For example, my NASA GDS projects looked like this:
>
> GDS
>      sal
>
>      common
>
>      map
>
>      dscovr
>
> All four of these are projects. "sal" and "common" are lower level; they
> are used by "map" and "dscovr", which are the projects used by the MAP
> and DSCOVR missions respectively (you can Google those ...). "sal" and

You work on very cool projects, no question about it. :)

(And MAP is apparently WMAP).

> "common" are listed as dependencies in the "map" and "dscovr" Ada
> project files. Nothing in "map" depends on "dscovr", and vice-versa.

There is a choice here, would you always use the same project 
instance/configuration when working on any of them (option 1, see 
below), or would you use different project instances when working on map 
and dscovr (option 2).

> ...
 > Any GDS team member can edit any
> file in any project.

I'm going to assume that they not only can, but also do that, with some 
regularity.

> The only thing that is a "library" is the Ada runtime library, installed
> with the Ada compiler.

That's fine. In the general case, though, you could have some 
third-party libraries installed as well, right?

> So for the dscovr project, what goes in project-roots, and what goes in
> project-library-roots, and why?

Apparently you're going with option 2.

Then project-roots will contain dscovr, sal and common. And 
library-roots will have what's left in the search path (Ada runtime 
library).

Personally, I expect that to be useful (e.g. limiting searches to the 
projects that you control). But if not, you an also disregard that 
distinction. Do you see any downsides to it?

> Note that the Ada project tool provides only one "source search path";
> it does not distinguish between "libraries" and "non-libraries". For the
> dscovr project, "dscovr", "sal", "common", and the runtime library are
> in the search path.

I'm hoping that you can still distinguish sal and common from the 
standard library somehow, programmatically.

>>> I could write a new global xref backend, but it's better to reuse
>>> existing code.
>>
>> Does lisp/cedet/cedet-global.el have code that will help us with
>> implementing "find definitions" using Global?
>
> Yes. I've started an implementation that does that:

That's great. I've also been thinking of the "tag by name" 
implementation for Grep, to use as a slow fallback. So far, it involves 
piggybacking on font-lock.

>> We have both project-find-regexp and project-or-libraries-find-regexp
>> already, and I find the difference between them useful in practice.
>
> Yes, sorry, I temporarily forgot about those; they are new.
>
> xref-find-references needs similar treatment to be consistent. But I

Thus far xref-find-references doesn't depend on the presence of "current 
project" (some implementations might use, some might not).

So creating two variations of xref-find-references would be incongruous, 
even if maybe useful.

> think that's the wrong approach; adding a more general user-specified
> predicate function is much better.

If you only accept user-specified predicates, you're assuming that the 
project backend can't provide any useful information to classify the 
directories. Whereas I think it pretty handy if the user doesn't have to 
write any code to start taking advantage of some basic distinctions 
(like "project contents" vs "libraries").

I'm open to the ideas in this direction, but the UI must be better than M-:.



  reply	other threads:[~2015-11-11 13:21 UTC|newest]

Thread overview: 162+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 20:23 find-file-project Stephen Leake
2015-09-15 22:21 ` find-file-project Dmitry Gutov
2015-09-16  2:49   ` find-file-project Stephen Leake
2015-09-16  3:26     ` find-file-project Stephen Leake
2015-09-16  3:34       ` find-file-project Stephen Leake
2015-09-16  3:38       ` find-file-project Dmitry Gutov
2015-09-16 12:56         ` find-file-project Stephen Leake
2015-09-16 14:37           ` find-file-project Dmitry Gutov
2015-09-16 16:41             ` find-file-project Stephen Leake
2015-09-16 16:59               ` find-file-project Stephen Leake
2015-09-16 17:13                 ` find-file-project Dmitry Gutov
2015-09-16 17:25               ` find-file-project Dmitry Gutov
2015-09-16 21:01                 ` find-file-project Stephen Leake
2015-09-17 17:45                   ` find-file-project Dmitry Gutov
2015-09-18 16:08                     ` project.el semantics Stephen Leake
2015-09-19  0:17                       ` Dmitry Gutov
2015-11-08  1:47                       ` Dmitry Gutov
2015-11-08  7:11                         ` Stephen Leake
2015-11-08 13:07                           ` Dmitry Gutov
2015-11-08 20:11                             ` Dmitry Gutov
2015-11-09  9:10                             ` Stephen Leake
2015-11-09 13:27                               ` Dmitry Gutov
2015-11-09 18:15                                 ` Stephen Leake
2015-11-10  1:32                                   ` Dmitry Gutov
2015-11-10  2:40                                   ` Dmitry Gutov
2015-11-10 17:36                                     ` Stephen Leake
2015-11-11  0:47                                       ` Dmitry Gutov
2015-11-11 10:27                                         ` Stephen Leake
2015-11-11 13:21                                           ` Dmitry Gutov [this message]
2015-11-11 16:48                                             ` John Wiegley
2015-11-11 17:03                                               ` Dmitry Gutov
2015-11-11 17:22                                                 ` John Wiegley
2015-11-11 21:46                                                   ` Dmitry Gutov
2015-11-11 22:30                                                     ` John Wiegley
2015-11-12  2:21                                                       ` Dmitry Gutov
2015-11-12 17:26                                                         ` John Wiegley
2015-11-12 17:53                                                           ` Dmitry Gutov
2015-11-12 18:04                                                             ` Dmitry Gutov
2015-11-12 18:17                                                             ` John Wiegley
2015-11-12 18:26                                                               ` John Mastro
2015-11-12 23:37                                                                 ` Dmitry Gutov
2015-11-12 18:50                                                               ` Dmitry Gutov
2015-11-11 22:41                                                   ` Stephen Leake
2015-11-11 22:14                                             ` Stephen Leake
2015-11-11 23:26                                               ` Dmitry Gutov
2015-11-12  6:44                                                 ` Stephen Leake
2015-11-12 11:32                                                   ` Dmitry Gutov
2015-11-12 19:28                                                     ` Stephen Leake
2015-11-12 22:04                                                       ` Dmitry Gutov
2015-11-19  2:21                                                         ` Dmitry Gutov
2015-11-20 18:40                                                           ` John Wiegley
2015-11-21 10:03                                                           ` Stephen Leake
2015-11-21 10:10                                                             ` Stephen Leake
2015-11-22  5:18                                                             ` John Wiegley
2015-11-22  5:36                                                               ` Dmitry Gutov
2015-11-22  5:43                                                                 ` John Wiegley
2015-11-22  5:58                                                                   ` Dmitry Gutov
2015-11-22 16:55                                                                     ` John Wiegley
2015-11-22 17:13                                                                       ` Dmitry Gutov
2015-11-22 19:54                                                                         ` John Wiegley
2015-11-22 21:27                                                                           ` John Wiegley
2015-11-23  1:14                                                                             ` Dmitry Gutov
2015-11-23 22:04                                                                               ` Steinar Bang
2015-11-23 23:17                                                                                 ` Dmitry Gutov
2015-11-23  7:43                                                                             ` Stephen Leake
2015-11-23 12:59                                                                               ` Dmitry Gutov
2015-12-16  4:06                                                                             ` Dmitry Gutov
2015-12-16  6:52                                                                               ` John Wiegley
2015-12-28  4:20                                                                                 ` Dmitry Gutov
2015-11-22 22:04                                                                       ` Stephen Leake
2015-11-22 23:21                                                                         ` Dmitry Gutov
2015-11-23  2:06                                                               ` Richard Stallman
2015-11-22  5:32                                                             ` Dmitry Gutov
2015-11-09 22:16                                 ` John Wiegley
2015-11-10  0:58                                   ` Dmitry Gutov
2015-11-10  1:07                                     ` John Wiegley
2015-11-10  1:18                                       ` Dmitry Gutov
2015-11-10  1:40                                         ` John Wiegley
2015-11-10  3:23                                           ` Dmitry Gutov
2015-11-10  6:00                                             ` John Wiegley
2015-11-10 10:54                                               ` Dmitry Gutov
2015-11-10 14:21                                                 ` John Wiegley
2015-11-10 23:41                                                 ` Stephen Leake
2015-11-11  0:56                                                   ` Dmitry Gutov
2015-11-11  1:17                                                     ` John Wiegley
2015-11-11  1:31                                                       ` Dmitry Gutov
2015-11-11  9:55                                                         ` Stephen Leake
2015-11-11 13:30                                                           ` Dmitry Gutov
2015-11-12  8:46                                                             ` Steinar Bang
2015-11-12 19:35                                                               ` Stephen Leake
2015-11-11  9:44                                                     ` Stephen Leake
2015-11-11 13:39                                                       ` Dmitry Gutov
2015-11-10 17:38                                             ` Stephen Leake
2015-11-10 19:47                                               ` Dmitry Gutov
2015-09-16  4:41     ` find-file-project Dmitry Gutov
2015-09-16 13:04       ` find-file-project Stefan Monnier
2015-09-16 17:01         ` find-file-project Stephen Leake
2015-09-16 13:31       ` find-file-project Stephen Leake
2015-09-16 14:13         ` find-file-project Stephen Leake
2015-09-16 15:05           ` find-file-project Dmitry Gutov
2015-09-16 16:58             ` find-file-project Stephen Leake
2015-09-17 17:15               ` find-file-project Dmitry Gutov
2015-09-18 17:14                 ` project.el semantics Stephen Leake
2015-09-19  0:08                   ` Dmitry Gutov
2015-09-19 12:07                     ` Stephen Leake
2015-09-19 12:40                       ` Dmitry Gutov
2015-09-16 17:04         ` find-file-project Dmitry Gutov
2015-09-16 21:11           ` find-file-project Stephen Leake
2015-09-17 17:52             ` find-file-project Dmitry Gutov
2015-09-17  1:26           ` find-file-project Stefan Monnier
2015-09-17 18:09             ` find-file-project Dmitry Gutov
2015-09-18 17:07               ` find-file-project Stefan Monnier
2015-09-18 23:41                 ` find-file-project Dmitry Gutov
2015-09-19  4:13                   ` find-file-project Stefan Monnier
2016-01-06  1:29                 ` find-file-project Dmitry Gutov
2016-01-07  4:52                   ` find-file-project Stefan Monnier
2016-01-07 17:09                     ` find-file-project Dmitry Gutov
2016-01-07  7:12                   ` find-file-project Stephen Leake
2016-01-07 17:55                     ` find-file-project Dmitry Gutov
2016-01-07 18:26                     ` find-file-project Dmitry Gutov
2016-01-07 19:58                       ` find-file-project Stephen Leake
2016-01-07 21:12                         ` find-file-project Dmitry Gutov
2016-01-08 19:11                           ` find-file-project Stephen Leake
2016-01-08 23:49                             ` find-file-project Dmitry Gutov
2016-01-09 12:18                               ` find-file-project Stephen Leake
2016-01-09 17:11                                 ` find-file-project Dmitry Gutov
2016-01-08  1:26                   ` find-file-project John Wiegley
2016-01-08  1:38                     ` find-file-project Dmitry Gutov
2016-01-08  2:19                       ` find-file-project Richard Copley
2016-01-08 11:34                         ` find-file-project Dmitry Gutov
2016-01-08  7:39                       ` find-file-project Stefan Monnier
2016-01-19  6:15                         ` find-file-project Dmitry Gutov
2016-01-19 14:20                           ` find-file-project Stefan Monnier
2016-01-20  0:51                             ` find-file-project Dmitry Gutov
2016-01-20  1:32                               ` find-file-project Stefan Monnier
2016-01-20  1:47                                 ` find-file-project Dmitry Gutov
2016-01-20  2:25                                   ` find-file-project Stefan Monnier
2016-01-20 15:40                                     ` find-file-project Dmitry Gutov
2016-01-20 21:58                                       ` find-file-project Stefan Monnier
2016-01-20 22:12                                         ` find-file-project Dmitry Gutov
2016-01-20 22:17                                           ` find-file-project Drew Adams
2016-01-20 22:26                                             ` find-file-project Dmitry Gutov
2016-01-20 22:48                                               ` find-file-project Drew Adams
2016-01-20 22:50                                                 ` find-file-project Dmitry Gutov
2016-01-20 23:09                                                   ` find-file-project Drew Adams
2016-01-20 23:23                                                     ` find-file-project Dmitry Gutov
2016-01-20 23:46                                                       ` find-file-project Drew Adams
2016-01-20 23:51                                                         ` find-file-project Dmitry Gutov
2016-01-21  0:08                                                           ` find-file-project Drew Adams
2016-01-21  0:21                                                             ` find-file-project Dmitry Gutov
2016-01-21  3:03                                 ` find-file-project Dmitry Gutov
2016-01-21 13:46                                   ` find-file-project Stefan Monnier
2016-01-17 21:23                       ` find-file-project John Wiegley
2016-01-17 21:25                         ` find-file-project Dmitry Gutov
2016-01-17 23:07                           ` find-file-project John Wiegley
2016-01-18  1:42                             ` find-file-project Dmitry Gutov
2015-09-16  7:16   ` find-file-project Eli Zaretskii
2015-09-16 13:06     ` find-file-project Stefan Monnier
2015-09-16 13:40     ` find-file-project Stephen Leake
2015-09-16 14:32       ` find-file-project Eli Zaretskii
2015-09-16 14:57       ` find-file-project Dmitry Gutov
2015-09-16 17:03         ` find-file-project Stephen Leake

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=564340DC.5020008@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=jwiegley@gmail.com \
    --cc=stephen_leake@stephe-leake.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).