unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: philip@warpmail.net, theo@thornhill.no, emacs-devel@gnu.org
Subject: Re: master 1e3b0f2: Improve doc strings of project.el
Date: Sun, 21 Jun 2020 02:11:18 +0300	[thread overview]
Message-ID: <f50c104f-aa8e-532e-e514-766830ebb679@yandex.ru> (raw)
In-Reply-To: <831rmavsuq.fsf@gnu.org>

On 20.06.2020 15:12, Eli Zaretskii wrote:

>> I don't know about that. Interpreting that literally would mean that
>> such buffers would never be suggested because they "belong to some other
>> project" (according to the reasoning which gave rise to this wording) no
>> matter which of the projects is the current one: "the outer", or "the
>> inner".
>>
>> So what we should say is just "belongs to the current project".
> 
> Not sure I understand.  The current doc string says
> 
>      "Switch to another buffer that is related to the current project.
>    A buffer is related to a project if its `default-directory'
>    is inside the directory hierarchy of the project's root."
> 
> You want to change the last sentence to say
> 
>    A buffer is related to a project if it belongs to the project.
> 
> ?

It could say "A buffer is related to project PR if 'project-current', 
when called in it, returns a value equal to PR". But that could be 
considered tautological.

So alternatively, the first line would just say

   Switch to another buffer that belongs to the current project.

But only if the implementation is made more precise in this respect.

>> The implication being that if it's inside a nested project, it
>> doesn't belong to the outer one.
> 
> How will this implication become apparent to the users, if the doc
> string doesn't discuss the significance of being "nested"?

The doc string of project-try-vc can describe that. Or the general 
description of VC projects, in the Commentary header and/or the manual.

>>> No, it isn't.  I'm working on a single project, but need to look
>>> outside of its directory to find some information.  A very natural
>>> thing to do, and it doesn't mean I started working on another
>>> project.  More importantly, I do want that Grep buffer be available to
>>> me as part of the current project, because I'm likely to return there
>>> more than once.
>>
>> And bookmarks/switch-to-buffer/registers are not good options for this goal?
> 
> The problem I raised is that such a Grep buffer will not be offered as
> a completion candidate when it is definitely relevant to my work on a
> project.  You suggest that I don't use the project.el commands, which
> is exactly what bothers me: it means that project.el commands don't
> support well a very simple project-related activity, which for me is
> a very frequent one.

It is a possibility.

But so far I don't understand very well whether your usage habits and 
the view of how a project should be defined are common enough, or fairly 
singular.

In any case, we should weigh the added complexity of implementing it 
(using any of the proposed ways) against the added utility.

For instance, you also said that you generally work on a single project 
at once (in an Emacs session). I could have misunderstood you there, but 
if that's true, the added benefit of using project-switch-to-buffer, as 
opposed to switch-to-buffer, would be marginal.

The reason the former function was added, as I see it, is for people who 
switch between different projects in the same session to be able to 
"narrow down" their view of the buffer list, to more easily find the one 
they are currently looking for.

>> Make sure project-vc-external-roots-function points to a function that
>> returns a list which includes the "other" directory. By default, it will
>> include the directories where tags tables reside.
> 
> But I don't want all the files in that directory to be part of the
> project.  I want just the Grep buffer.

Fair enough.

> And anyway, coming up with a function that does some job is not a
> user-level operation, at least not when the user needs to do it every
> now and then, when the work on a project takes him/her outside of a
> directory.  We need easier facilities, like commands and simple-valued
> variables.

Alternatively, it could be a customization variable you could set in 
some .dir-locals.el. Or a full-blown configuration file, specific to a 
new project backend, that would list which files belong to which 
projects. Not sure if such configurations would reside in some "project 
roots" (the meaning of the term becomes a bit blurry when project files 
are allowed to reside outside of its directory tree), or inside .emacs.d.

>>>> To reuse your argument, 'M-x switch-to-buffer' is still available for
>>>> borderline cases.
>>>
>>> An argument that you dismissed previously.
>>
>> I dismissed it as in "people wanted to call this command less". But my
>> specific wording also made provision for it being necessary at least
>> sometimes.
>>
>> But you made this argument. So perhaps it may be good enough for your
>> purposes. Am I wrong here?
> 
> How can it be good enough for my purposes, but not good enough for
> those of others?  What kind of logic is this?

Different usage patterns. I'm sure you're familiar with that notion.

>> I don't want to dismiss your request outright, but we'll need to have
>> some design which would fit the existing model and/or wouldn't be hard
>> to support.
> 
> I presented a critique of the current design, whereby the buffer's
> default-directory is used to decide whether the buffer belongs to a
> project.  I presented several examples where this design doesn't do
> what I as a user expect.  If you don't want to dismiss that critique
> outright, I'd expect you to come up with some changes that would
> support the use cases I described.  That is the expected response to a
> critique such as the one I presented.  I don't understand why you
> expect _me_ to have some design, I'm not working on developing
> project.el, I'm just a (potential) user of it.

I don't want to dismiss the critique outright. Believe it or not, I 
really do want you, personally, to be happier and more productive as a 
result of things I do here. I spent several hours today just thinking 
about this discussion. But our workflows are different, and expectations 
are different as well, and it seems that your requests tend to conflict 
with some design choices I have originally made.

One of them was to make the VC project a hands-off backend, one that 
immediately "just works" (or tries to), with a few possibilities for 
customization through local variables.

Consider also that your critique might be based on a different view of 
what a "project" is.

In my understanding, it is, roughly speaking, a directory with files. 
Some of them are "junk", build artefacts and the like. But the rest 
usually support a program, or a document, etc, and together they result 
in one whole. Some stuff working together. A project could have 
dependencies, they often reside outside of that directory (but not 
always), but they aren't as much a part of the said project.

Consequently, if there is a regexp search across these files, I 
immediately consider that search (the process, and the search results) a 
part of that project. Because it searches in that project's files. No 
matter the end goal of that search.

You seem to think (and this is only my guess, of course) that a project 
is a unit of work. And that whatever files, or activities, are pertinent 
to your current goal, are a part of that project. Hence, if you do a 
search anywhere, in any directory, but in pursuit of that goal, the 
search results are certainly a part of the current project. It is 
certainly a valid viewpoint, but one that I have never considered before.

I _think_ (though I can't be sure) that the former viewpoint is more 
prevalent among other editors, and among our users as well. And with 
that definition, your example doesn't show anomalous behavior, and the 
outcome is something that a user would expect. Even if someone might say 
that they would be able to reach that Grep buffer quickly by this or 
other means.

So I'm not sure where to go from here. If the latter viewpoint has more 
supporters, perhaps an new, alternative backend is the way to go. This 
would be a test of the API, how well it adapts to different goals.

But it we were able to adopt the same language, perhaps that would be 
more productive after all. And we might reach the additional goals by 
other means.

>>> I think that non file-visiting buffers are rarely related to a
>>> project, an exception rather than a rule.  My suggestion is therefore
>>> to turn the table and come up with a list of such buffers that
>>> _always_ are related to a specific project.  And instead of using the
>>> default-directory as evidence for the buffer's relevance, we may need
>>> a command that explicitly makes a buffer related to a project.
>>
>> Well, Phil gave a list of examples. And in all of those cases, I think,
>> default-directory worked well as an indicator.
> 
> The same examples could be supported by having a list of buffers that
> should be considered.  Whether such an explicit list is a good or a
> bad idea depends on how long it will have to be.  That is why I
> suggested to see how many such buffers are there, because I suspect
> there are only a few.

IMO (and I know at least some people who hold a similar view), 
constructing a list of buffers/files/etc that constitute the current 
project by hand, is not user-friendly.

So I'd rather the default behavior didn't require extra hand-holding by 
the user.

> By contrast, making a far-reaching decision that default-directory is
> all we need, based on such a small sample, might produce sub-optimal
> results, as I described.

So far it's not a done decision, and a lot can be improved as a result 
of this and nearby discussions.

A far-reaching decision would be to make an API change, or to add a new 
backend.



  parent reply	other threads:[~2020-06-20 23:11 UTC|newest]

Thread overview: 149+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200619075401.21856.16524@vcs0.savannah.gnu.org>
     [not found] ` <20200619075402.CE1D220A27@vcs0.savannah.gnu.org>
2020-06-19 11:01   ` master 1e3b0f2: Improve doc strings of project.el Dmitry Gutov
2020-06-19 11:24     ` Eli Zaretskii
2020-06-19 11:37       ` Basil L. Contovounesios
2020-06-19 11:50         ` Eli Zaretskii
2020-06-19 12:30       ` Dmitry Gutov
2020-06-19 12:44         ` Eli Zaretskii
2020-06-19 12:54           ` Dmitry Gutov
2020-06-19 13:27             ` Philip K.
2020-06-19 13:34               ` Dmitry Gutov
2020-06-19 14:11               ` Eli Zaretskii
2020-06-19 14:18                 ` Dmitry Gutov
2020-06-19 14:24                   ` Eli Zaretskii
2020-06-19 14:41                     ` Philip K.
2020-06-20  7:22                       ` Eli Zaretskii
2020-06-19 14:25                 ` Theodor Thornhill
2020-06-19 14:37                   ` Eli Zaretskii
2020-06-19 14:49                     ` Dmitry Gutov
2020-06-19 15:11                       ` Eli Zaretskii
2020-06-19 18:33                         ` Dmitry Gutov
2020-06-19 19:01                           ` Eli Zaretskii
2020-06-19 19:28                             ` Dmitry Gutov
2020-06-20  6:43                               ` Eli Zaretskii
2020-06-20  7:43                                 ` Theodor Thornhill
2020-06-20  8:55                                   ` Eli Zaretskii
2020-06-20  9:29                                     ` Theodor Thornhill
2020-06-20 10:07                                       ` Eli Zaretskii
2020-06-20 10:19                                         ` Theodor Thornhill
2020-06-20 11:37                                           ` Dmitry Gutov
2020-06-20 11:35                                         ` Dmitry Gutov
2020-06-20 12:32                                           ` Eli Zaretskii
2020-06-20 22:21                                             ` Dmitry Gutov
2020-06-20 11:29                                     ` Dmitry Gutov
2020-06-20 11:46                                       ` Kévin Le Gouguec
2020-06-20 11:57                                         ` Dmitry Gutov
2020-06-20 12:37                                           ` Eli Zaretskii
2020-06-20 21:18                                             ` Dmitry Gutov
2020-06-20 12:25                                       ` Eli Zaretskii
2020-06-20 23:17                                         ` Dmitry Gutov
2020-06-20 11:25                                 ` Dmitry Gutov
2020-06-20 12:12                                   ` Eli Zaretskii
2020-06-20 12:30                                     ` Basil L. Contovounesios
2020-06-20 12:42                                       ` Eli Zaretskii
2020-06-20 23:11                                     ` Dmitry Gutov [this message]
2020-06-21 15:08                                       ` Eli Zaretskii
2020-06-21 22:24                                         ` Juri Linkov
2020-06-22  2:27                                           ` Eli Zaretskii
2020-06-28  0:56                                         ` Dmitry Gutov
2020-06-28 14:28                                           ` Eli Zaretskii
2020-06-28 22:35                                             ` Dmitry Gutov
2020-06-29 14:50                                               ` Eli Zaretskii
2020-06-29 15:07                                                 ` Stephen Leake
2020-06-29 22:35                                                   ` Juri Linkov
2020-07-01 22:02                                                     ` Dmitry Gutov
2020-07-01 22:07                                                   ` Dmitry Gutov
2020-07-01 22:57                                                 ` Dmitry Gutov
2020-07-04  7:15                                                   ` Eli Zaretskii
2020-07-04 22:22                                                     ` Dmitry Gutov
2020-07-05 14:26                                                       ` Eli Zaretskii
2020-07-05 19:45                                                         ` Dmitry Gutov
2020-07-07 15:04                                                           ` Eli Zaretskii
2020-07-07 15:23                                                             ` Dmitry Gutov
2020-07-10 14:27                                                               ` Eli Zaretskii
2020-07-10 14:57                                                                 ` Dmitry Gutov
2020-07-10 18:14                                                                   ` Eli Zaretskii
2020-07-10 19:36                                                                     ` Dmitry Gutov
2020-07-11  6:58                                                                       ` Eli Zaretskii
2020-07-11 11:29                                                                         ` Dmitry Gutov
2020-07-11 12:35                                                                           ` Eli Zaretskii
2020-07-12  0:48                                                                             ` Dmitry Gutov
2020-07-12 14:00                                                                               ` Eli Zaretskii
2020-07-12 14:16                                                                                 ` Dmitry Gutov
2020-07-12 14:47                                                                                   ` Eli Zaretskii
2020-07-12 15:08                                                                                     ` Dmitry Gutov
2020-07-12 15:36                                                                                       ` Eli Zaretskii
2020-07-12 16:17                                                                                         ` Eli Zaretskii
2020-07-13  1:51                                                                                           ` Dmitry Gutov
2020-07-13  4:40                                                                                             ` Eli Zaretskii
2020-07-13  7:11                                                                                               ` Gregory Heytings via Emacs development discussions.
2020-07-13  7:21                                                                                                 ` Eli Zaretskii
2020-07-13  7:52                                                                                                   ` Gregory Heytings via Emacs development discussions.
2020-07-13  8:53                                                                                                     ` Eli Zaretskii
2020-07-13 18:26                                                                                                       ` Dmitry Gutov
2020-07-13  7:58                                                                                                 ` tomas
2020-07-17 10:27                                                                                                   ` Dmitry Gutov
2020-07-17 15:27                                                                                                     ` tomas
2020-07-18  0:55                                                                                                       ` Dmitry Gutov
2020-07-18  9:05                                                                                                         ` tomas
2020-07-18 10:10                                                                                                           ` Eli Zaretskii
2020-07-18 11:58                                                                                                             ` Dmitry Gutov
2020-07-18 19:14                                                                                                           ` Dmitry Gutov
2020-07-19  2:27                                                                                                             ` Richard Stallman
2020-07-19 21:59                                                                                                               ` Dmitry Gutov
2020-07-20  2:44                                                                                                                 ` Richard Stallman
2020-07-13 19:51                                                                                               ` Dmitry Gutov
2020-07-16 16:34                                                                                                 ` Eli Zaretskii
2020-07-16 18:55                                                                                                   ` Dmitry Gutov
2020-07-16 19:57                                                                                                     ` Eli Zaretskii
2020-07-16 21:02                                                                                                       ` Dmitry Gutov
2020-07-17  1:07                                                                                                     ` Richard Stallman
2020-07-17  1:30                                                                                                       ` Dmitry Gutov
2020-07-16 18:56                                                                                                   ` Dmitry Gutov
2020-07-16 19:59                                                                                                     ` Eli Zaretskii
2020-07-16 20:53                                                                                                       ` Dmitry Gutov
2020-07-13  2:51                                                                                         ` Richard Stallman
2020-07-13 10:47                                                                                           ` Dmitry Gutov
2020-07-13 13:00                                                                                             ` Eli Zaretskii
2020-07-13 15:24                                                                                               ` Dmitry Gutov
2020-07-13 16:30                                                                                                 ` Eli Zaretskii
2020-07-13 19:01                                                                                                   ` Dmitry Gutov
2020-07-13 19:41                                                                                                     ` Eli Zaretskii
2020-07-13 21:39                                                                                                       ` Dmitry Gutov
2020-07-11 12:59                                                                           ` Michael Albinus
2020-07-12 14:49                                                                             ` Dmitry Gutov
2020-07-12 17:19                                                                               ` Michael Albinus
2020-06-28 22:14                                         ` Dmitry Gutov
2020-06-29 14:32                                           ` Eli Zaretskii
2020-06-19 15:02                     ` Dmitry Gutov
2020-06-19 15:13                       ` Eli Zaretskii
2020-06-19 18:23                         ` Dmitry Gutov
2020-06-19 18:44                           ` Eli Zaretskii
2020-06-19 18:49                             ` Dmitry Gutov
2020-06-19 19:07                               ` Eli Zaretskii
2020-06-19 15:02                     ` Theodor Thornhill via Emacs development discussions.
2020-06-19 15:19                       ` Eli Zaretskii
2020-06-19 15:39                         ` Theodor Thornhill
2020-06-19 17:11                           ` Eli Zaretskii
2020-06-19 17:46                             ` Theodor Thornhill
2020-06-19 18:03                               ` Eli Zaretskii
2020-06-19 18:19                                 ` Dmitry Gutov
2020-06-19 18:36                                   ` Eli Zaretskii
2020-06-19 18:49                                     ` Dmitry Gutov
2020-06-19 18:22                                 ` Theodor Thornhill
2020-06-19 18:41                                   ` Eli Zaretskii
2020-06-19 18:57                                     ` Theodor Thornhill
2020-06-19 19:10                                       ` Dmitry Gutov
2020-06-19 20:08                                         ` theo
2020-06-19 19:04                                     ` Dmitry Gutov
2020-06-19 19:12                                       ` Eli Zaretskii
2020-06-19 19:33                                         ` Dmitry Gutov
2020-06-20  7:20                                           ` Eli Zaretskii
2020-06-20 11:41                                             ` Dmitry Gutov
2020-06-20 12:36                                               ` Eli Zaretskii
2020-06-20 21:58                                                 ` Dmitry Gutov
2020-06-19 18:21                           ` Dmitry Gutov
2020-06-19 18:30                             ` Theodor Thornhill
2020-06-19 14:07             ` Eli Zaretskii
2020-06-19 14:23               ` Dmitry Gutov
2020-06-19 14:28                 ` Eli Zaretskii
     [not found] <<87bllfqj82.fsf@warpmail.net>
     [not found] ` <<83o8pfxhzq.fsf@gnu.org>
     [not found]   ` <<I2nnldrvYQuQLpqgZyK7owqcMuP8kMtAdgkVXzq66i2hg6TgDaYFJe4RMj19j0J9Z1WqR9_vbifeegWNOLS3BBv-R34nJLuXYurqIVrefNE=@thornhill.no>
     [not found]     ` <<83imfnxgt3.fsf@gnu.org>
     [not found]       ` <<626efe11-0f9c-081b-11dd-0d61cee8168d@yandex.ru>
     [not found]         ` <<83h7v7xf7w.fsf@gnu.org>
     [not found]           ` <<b7f4a9ba-4320-b7b2-e150-74d667943ecd@yandex.ru>
     [not found]             ` <<831rmayj55.fsf@gnu.org>
     [not found]               ` <<6dc2c2ac-8e17-f044-dc78-8c109f936ad2@yandex.ru>
     [not found]                 ` <<83wo42w83e.fsf@gnu.org>
     [not found]                   ` <<6762abf5-71c1-aa54-1bac-d4c90c20870b@yandex.ru>
     [not found]                     ` <<831rmavsuq.fsf@gnu.org>
2020-06-20 22:55                       ` Drew Adams

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=f50c104f-aa8e-532e-e514-766830ebb679@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=philip@warpmail.net \
    --cc=theo@thornhill.no \
    /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).