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>, emacs-devel@gnu.org
Subject: Re: project.el semantics
Date: Wed, 11 Nov 2015 23:46:49 +0200	[thread overview]
Message-ID: <5643B749.8030600@yandex.ru> (raw)
In-Reply-To: <m2r3jwladh.fsf@Vulcan.attlocal.net>

On 11/11/2015 07:22 PM, John Wiegley wrote:

>> It's supposed to be a generic replacement for the top-level EDE ede-project
>> class, more or less.
>
> Except I don't know what that is. :(

ede-project is defined in lisp/cedet/ede/base.el. I think its defclass 
declaration is all that you need to know for this discussion.

It's the top parent of any EDE project. If someone wants to write a 
command acting on the current project, and they want it to work on any 
kind of EDE project, they would have to use the info that ede-project 
provides.

>> Those are outside. Does "external to the project" sound better?
>
> Ah, I think so, yes. "Ancillary roots" might be even better.

I meant "external to the project" instead of "outside the project", of 
course. In the project-library-roots docstring. But you seem to mean a 
rename, right?

Do you really think "project-ancillary-roots" is better than 
"project-library-roots"? The word "ancillary" doesn't mean anything (or 
it can mean basically anything). "Library" at least evokes some 
associations.

>> Since you both don't understand the few sentences that seem clear to me, I'm
>> apparently an utter failure of a technical writer. Which is not terribly
>> surprising, considering it's my second language.
>
> I don't mean to criticize your writing. It's hard to speak at the level of
> precise specification.

Yet by now I've spent a gargantuan amount of time writing these emails, 
as well as comments and docstrings in project.el. If reading them 
doesn't make things clearer to other people, maybe I should take up 
another, more productive hobby.

I honestly expected an "I see what you mean", or at least some targeted 
questions about the sentences I've already written. Not "I still don't 
understand what X and Y means".

>> Not "within the project", but related to the project. Does the term
>> "library" sound familiar?
>
> OK, this is starting to make more sense now. So, you're saying that *within* a
> project there are both distinguished directories, and file subsets with common
> meaning;

A project consists of directories. Most often, it consists of just one 
directory, but there are odd configurations where it's spread over 
several directories (Stephen gave some examples). It's not hard to 
support that case, so it's "project roots" now, instead of "project root".

We've not reached the stage where we want to group different kinds of 
files within the project somehow, yet. But we have project-ignores, so 
you might say it splits files into two groups (ignored and not).

> and *outside* the project (say, in "/usr/include"), that are likewise
> distinguished directories and file subsets with common meaning.

Yes. And `project-library-roots-function' docstring mentions "headers 
search path, load path, class path".

> What we may want to do is avoid the concept "root" entirely, and talk instead
> about general "filesets": That is, every "project" would have 0 or more
> associated filesets, and a way to identify which project (perhaps multiple!)
> that a given buffer is associated with.

That suggestion seems orthogonal. Does "project library filesets" sound 
more clear to you than "project library roots" or "project library root 
directories"? Does the difference between "project library filesets" and 
"project filesets" become more apparent?

The names ending with "-roots" mean the elements of the returned lists 
are treated in a recursive fashion (everything within each of project 
roots, including subdirectories, belongs to the project).

> A fileset could be defined as:
>
>      Everything within a directory
>      Everything within a directory tree
>      Everything within a directory or tree matching a predicate
>
> In the most general case, a fileset is determined by whatever function the
> user provides in .dir-locals.el.

What function? Each user will have to write a function now?

I'm happy to discuss patches along these lines, but please note that 
you're proposing to drastically increase the API's complexity, and 
you're not solving any of what I see as the two immediate problems (and 
the "feature freeze" is the day after tomorrow):

- The disagreement around what "library roots" means (or library 
filesets, etc). And whether we should have that in the API.

- Dealing with "library roots" for projects with multiple source 
languages inside, in an automatic fashion, without a combinatoric 
explosion of project backends. This is the first FIXME in project.el 
talks about. Would you like to comment on it?

> Filesets in turn have an extensible set of attributes:
>
>      Is the file part of the project, or external to it?
>      Is it under version control?
>      Is it a build product?
>      Should it be searched, tagged, presented in various contexts, etc.?
>        (This itself might be an extensible sublist)

I'd expect to see a justification for each of these features.

"Under version control" - this question is answered by VC. Why would we 
have that in the project API?

"build product" - why not simply ignore those using project-ignores?

"Should it be searched, tagged, presented in various contexts" - that 
description sounds like a pony.

> This way we can talk in general terms, and not about concrete roots or
> directories. In the most abstract case, the notion of "project" should be
> entirely definable by the user, and may look nothing like what we presently
> have in mind.

The more flexible the API allows every project to me, the more trouble, 
in general, the consumers of the API are going to have with it.

Example one:

You want to have "filesets" instead of simply directories. We'll have a 
new data structure to decide on, and the API consumers will have figure 
out what filesets are, and how to work with them. Directories are 
trivial in comparison.

Two:

You want filesets to be allowed to include only immediate directory 
contents, or the contents of the whole directory tree.

That means that any consumer will have to handle both of these cases. 
E.g. xref-collect-matches will have to use two different code paths to 
handle both recursive and non-recursive traversals.

As we've discussed with Stephen previously, a "directory to traverse 
non-recursively" is equivalent to "directory to traverse recursively, 
but ignoring all its subdirectories", and the second part can be 
implemented via project-ignores (that lists all subdirectories of the 
directory in question). That results in just one code path in all consumers.

Stephen still wanted to support both recursive and non-recursive 
traversals explicitly, so if you both insist on that, I guess I will 
give in.

Three:

Allowing "Everything within a directory or tree matching a predicate" 
means, I believe, that searching through the fileset won't be possible 
to implement with just one find+grep call. If that involves calling the 
predicate at each directory level, that is.

> It's even possible that a buffer without an associated file, say
> a *Compilation* buffer, could momentarily be considered part of a project, and
> as a candidate for cross-buffer searching within that project.

And that feature would mean that one can't implement searching through 
the project with find+grep at all. Do you consider it valuable enough, 
to give up on that simplicity?



  reply	other threads:[~2015-11-11 21:46 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
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 [this message]
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=5643B749.8030600@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --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).