From: Stephen Leake <stephen_leake@stephe-leake.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: John Wiegley <jwiegley@gmail.com>, emacs-devel@gnu.org
Subject: Re: project.el semantics
Date: Thu, 12 Nov 2015 00:44:07 -0600 [thread overview]
Message-ID: <86si4bemyw.fsf@stephe-leake.org> (raw)
In-Reply-To: <5643CEAA.6000103@yandex.ru> (Dmitry Gutov's message of "Thu, 12 Nov 2015 01:26:34 +0200")
Dmitry Gutov <dgutov@yandex.ru> writes:
> On 11/12/2015 12:14 AM, Stephen Leake wrote:
>
>> Ok, I can see the need for some sort of metadata. But that suggests:
>>
>> (cl-defgeneric project-metadata (project dir)
>> "Return interesting metadata for DIR in PROJECT."
>> ...)
>
> Yes, more or less. Instead of directories, we could have complex
> objects like John suggests, with their own properties, but the above
> seems be simpler.
>
>> We need more examples of useful metadata before we can begin to design a
>> format for the return result.
>
> Probably. I just have in mind one tag so far, e.g. let's call it
> "category". There might be none (in which case the directory is a part
> of the project),
If I pass in a DIR that is _not_ related to the project, the category
should be something like "unknown". So we have at least four values for
category:
unknown
top-level (ie "the project")
library
other-dependency
But then there is also, orthogonal to category:
editable (or read-write)
read-only
>>> Then project-roots will contain dscovr, sal and common. And
>>> library-roots will have what's left in the search path (Ada runtime
>>> library).
>>
>> You did not answer the most important part of the question: "why?".
>
> Because, from dscovr depends on sal and common, and according to your
> description, the person working on dscovr can make changes to sal and
> common as well, if needed.
So you are focusing on the "read-only" vs "read/write" aspect.
> So a search across "current project, as
> well as code I edit together with it"
This is project-roots.
> would include dscovr, sal and common.
>
> Which sounds useful to me, but I don't really know your workflows. If
> the dscovr developer doesn't need to edit sal and common 98% of their
> time, maybe they should indeed go into project-library-roots.
Yes, the developer will want to search different subsets of the full
project at different times.
Which is why this needs to be more flexible.
The user should be able to specify a subset of the search path for each
search, at run-time. Having only project-roots and project-library-roots
available is too limiting.
> If they only need to edit sal or common for like 5-20% of their work
> on dscovr, maybe a finer distinction is needed, like three kinds of
> searches:
>
> - Across project-roots and project-library-roots.
>
> - project-roots only.
>
> - The one project roots the current buffer is in.
>
> Which complicates things a bit, but it's still simpler than having
> user predicates and arbitrary metadata.
The UI for a predicate is more complicated, yes. But the project.el API
is simpler; a single predicate arg is clearly simpler than the confusion
between project-roots and project-library-roots.
Which is why I keep emphasizing that project.el is _not_ about the UI.
>>> 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?
>>
>> Yes; it's not flexible enough. There were times when I wanted to search
>> only in map/, or only in sal/. I just used grep-find.
>
> You can also use C-u M-x project-find-regexp, and point it to map/ or
> sal/. Specifying a single directory is relatively easy anyway.
Not with the current API:
(defun project-find-regexp (regexp)
...)
How would I specify a single root or directory?
>> The predicate can query the metadata, via project-metadata.
>
> I can display all available metadata to the user, and ask: directories
> with which pieces of metadata set do you want to search? The user
> enters the category names, separated by spaces, and the search
> proceeds.
That would be a dialog-box style UI, yes.
> I can't do the same with predicates. I can't even list them all,
> really.
The dialog box uses the user input to construct a predicate, which it
passes to the project.el UI.
That's an example of what I had in mind; higher level code implementing
a nice UI to drive project.el functions.
The alternative to an arbitrary predicate function is to hard-code some
set of possible choices in the search code. Any such set is limiting.
It may be that we discover some commonly used predicates; they could be
standardized in project.el.
On the GDS project, one search we repeated often was for FIXME:
comments; we had some structure in them, identifying which release it
had to be fixed for, who was assigned to fix it, etc. So I could have
written a few predicates that take advantage of the structure, and used
a menu to select among them for a search.
>> We have to agree that the UI is a separate discussion, or we will get nowhere.
>
> The API should take possible UIs into account. Like described above,
Yes. Metadata query functions and search predicates work for a very
large variety of UIs (menus, dialog boxes, Siri), as well as a very
large variety of searches. "project-roots vs project-library-roots"
works for a similar set of UIs but a much smaller set of searches.
> if we standardize on metadata, I can imagine at least one UI. If we
> standardize on arbitrary predicates, it's much harder.
Metadata is provided by the backend to the client code. Predicates
are provided by the client code to the backend. They are complementary,
not mutually exclusive.
> This kind of change to the API should even come with a corresponding
> change proposal for xref-find-references, to demonstrate that it's
> viable.
Yes, I'll put it on my list.
--
-- Stephe
next prev parent reply other threads:[~2015-11-12 6:44 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
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86si4bemyw.fsf@stephe-leake.org \
--to=stephen_leake@stephe-leake.org \
--cc=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=jwiegley@gmail.com \
/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.