unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* vc-dir default directory: repository root?
@ 2015-01-10  6:52 Daniel Colascione
  2015-01-11  1:26 ` Stefan Monnier
                   ` (4 more replies)
  0 siblings, 5 replies; 49+ messages in thread
From: Daniel Colascione @ 2015-01-10  6:52 UTC (permalink / raw)
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 738 bytes --]

I'd like to apply this patch. When I use vc-dir, I almost always want to
look at the root of the repository, not the portion that contains the
file I'm editing. What do you think?

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 8bba79c..e050c94 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1241,7 +1241,7 @@ These are the commands available for use in the
file status buffer:
     ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d
     ;; you may get a new *vc-dir* buffer, different from the original
     (file-truename (read-directory-name "VC status for directory: "
-					default-directory default-directory t
+					(vc-root-dir) nil t
 					nil))
     (if current-prefix-arg
 	(intern


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-10  6:52 vc-dir default directory: repository root? Daniel Colascione
@ 2015-01-11  1:26 ` Stefan Monnier
  2015-01-11  8:33 ` Andreas Schwab
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 49+ messages in thread
From: Stefan Monnier @ 2015-01-11  1:26 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Emacs developers

> I'd like to apply this patch. When I use vc-dir, I almost always want to
> look at the root of the repository, not the portion that contains the
> file I'm editing. What do you think?

Looks good,


        Stefan



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-10  6:52 vc-dir default directory: repository root? Daniel Colascione
  2015-01-11  1:26 ` Stefan Monnier
@ 2015-01-11  8:33 ` Andreas Schwab
  2015-01-11 15:53 ` Wolfgang Jenkner
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 49+ messages in thread
From: Andreas Schwab @ 2015-01-11  8:33 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Emacs developers

Daniel Colascione <dancol@dancol.org> writes:

> I'd like to apply this patch. When I use vc-dir, I almost always want to
> look at the root of the repository, not the portion that contains the
> file I'm editing. What do you think?

Please make it easy to get back to the old behaviour.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-10  6:52 vc-dir default directory: repository root? Daniel Colascione
  2015-01-11  1:26 ` Stefan Monnier
  2015-01-11  8:33 ` Andreas Schwab
@ 2015-01-11 15:53 ` Wolfgang Jenkner
  2015-01-11 19:02 ` Dan Nicolaescu
  2015-01-19  1:38 ` Dmitry Gutov
  4 siblings, 0 replies; 49+ messages in thread
From: Wolfgang Jenkner @ 2015-01-11 15:53 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Emacs developers

On Fri, Jan 09 2015, Daniel Colascione wrote:

> I'd like to apply this patch. When I use vc-dir, I almost always want to
> look at the root of the repository, not the portion that contains the
> file I'm editing. What do you think?
[...]
>      (file-truename (read-directory-name "VC status for directory: "
> -					default-directory default-directory t
> +					(vc-root-dir) nil t

It's much more convenient to delete some trailing components of the
directory name than to add them.  I think that the current behaviour
makes sense, in particular for large or rather heterogeneous repos.


Wolfgang (stating the obvious)



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-10  6:52 vc-dir default directory: repository root? Daniel Colascione
                   ` (2 preceding siblings ...)
  2015-01-11 15:53 ` Wolfgang Jenkner
@ 2015-01-11 19:02 ` Dan Nicolaescu
  2015-01-19  1:40   ` Dmitry Gutov
  2015-01-19  1:38 ` Dmitry Gutov
  4 siblings, 1 reply; 49+ messages in thread
From: Dan Nicolaescu @ 2015-01-11 19:02 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Emacs developers

Daniel Colascione <dancol@dancol.org> writes:

> I'd like to apply this patch. When I use vc-dir, I almost always want to
> look at the root of the repository, not the portion that contains the
> file I'm editing. What do you think?

That's not a good idea.
This code is used by all VCs, and that behavior is not what SVN/CVS
users want...




> diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
> index 8bba79c..e050c94 100644
> --- a/lisp/vc/vc-dir.el
> +++ b/lisp/vc/vc-dir.el
> @@ -1241,7 +1241,7 @@ These are the commands available for use in the
> file status buffer:
>      ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d
>      ;; you may get a new *vc-dir* buffer, different from the original
>      (file-truename (read-directory-name "VC status for directory: "
> -					default-directory default-directory t
> +					(vc-root-dir) nil t
>  					nil))
>      (if current-prefix-arg
>  	(intern



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-10  6:52 vc-dir default directory: repository root? Daniel Colascione
                   ` (3 preceding siblings ...)
  2015-01-11 19:02 ` Dan Nicolaescu
@ 2015-01-19  1:38 ` Dmitry Gutov
  2015-01-19  3:01   ` Stefan Monnier
  4 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-19  1:38 UTC (permalink / raw)
  To: Daniel Colascione, Emacs developers

On 01/10/2015 08:52 AM, Daniel Colascione wrote:
> I'd like to apply this patch. When I use vc-dir, I almost always want to
> look at the root of the repository, not the portion that contains the
> file I'm editing. What do you think?

Looks fine, but personally, I still prefer http://debbugs.gnu.org/12492.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-11 19:02 ` Dan Nicolaescu
@ 2015-01-19  1:40   ` Dmitry Gutov
  2015-01-19 15:47     ` Dan Nicolaescu
  0 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-19  1:40 UTC (permalink / raw)
  To: Dan Nicolaescu, Daniel Colascione; +Cc: Emacs developers

On 01/11/2015 09:02 PM, Dan Nicolaescu wrote:

> that behavior is not what SVN/CVS users want...

Could you elaborate on that?

 From what I remember of working with SVN, there's not much difference 
from the modern VC systems, and you usually want to see the status of 
the whole repository.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-19  1:38 ` Dmitry Gutov
@ 2015-01-19  3:01   ` Stefan Monnier
  2015-01-19  4:54     ` Dmitry Gutov
  0 siblings, 1 reply; 49+ messages in thread
From: Stefan Monnier @ 2015-01-19  3:01 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Daniel Colascione, Emacs developers

>> I'd like to apply this patch. When I use vc-dir, I almost always want to
>> look at the root of the repository, not the portion that contains the
>> file I'm editing. What do you think?
> Looks fine, but personally, I still prefer http://debbugs.gnu.org/12492.

I think Daniel's patch is a good tradeoff, keeping the generality of the
current code and the advantage of a single command, while providing
a quick access to the common "open the root dir" case.


        Stefan



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-19  3:01   ` Stefan Monnier
@ 2015-01-19  4:54     ` Dmitry Gutov
  2015-01-19 14:16       ` Stefan Monnier
  0 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-19  4:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Daniel Colascione, Emacs developers

On 01/19/2015 05:01 AM, Stefan Monnier wrote:

> I think Daniel's patch is a good tradeoff,

It could be.

> keeping the generality of the
> current code and the advantage of a single command, while providing
> a quick access to the common "open the root dir" case.

But there are dissenting voices even for this patch. To satisfy them, 
we'd have to add a user option, and either way the user has to press RET.

My approach, on the other hand, implements the common case in the 
quickest way as a separate command, so anyone who doesn't like it can 
use `define-key' to revert the keybinding change.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-19  4:54     ` Dmitry Gutov
@ 2015-01-19 14:16       ` Stefan Monnier
  2015-01-19 14:55         ` Dmitry Gutov
  0 siblings, 1 reply; 49+ messages in thread
From: Stefan Monnier @ 2015-01-19 14:16 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Daniel Colascione, Emacs developers

> But there are dissenting voices even for this patch.

There always are.  We don't have to (and can't) accommodate everyone
(not even me).


        Stefan



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-19 14:16       ` Stefan Monnier
@ 2015-01-19 14:55         ` Dmitry Gutov
  2015-01-19 14:57           ` Daniel Colascione
  0 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-19 14:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Daniel Colascione, Emacs developers

On 01/19/2015 04:16 PM, Stefan Monnier wrote:

> There always are.  We don't have to (and can't) accommodate everyone
> (not even me).

Someone should feel free to go ahead with that patch, but here's another 
possible avenue for improvement: don't ask for the directory when 
there's an existing vc-dir buffer, and it's for a parent of/or the 
current directory.

Just display it, maybe not even refresh until the user asks. That will 
cut some of the prompts overhead as well.

Although if some users work on several dirs simultaneously, we'll need a 
way to force the directory selection, and the prefix argument is already 
taken.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-19 14:55         ` Dmitry Gutov
@ 2015-01-19 14:57           ` Daniel Colascione
  2015-01-19 22:43             ` Dmitry Gutov
  0 siblings, 1 reply; 49+ messages in thread
From: Daniel Colascione @ 2015-01-19 14:57 UTC (permalink / raw)
  To: Dmitry Gutov, Stefan Monnier; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

On 01/19/2015 06:55 AM, Dmitry Gutov wrote:
> On 01/19/2015 04:16 PM, Stefan Monnier wrote:
> 
>> There always are.  We don't have to (and can't) accommodate everyone
>> (not even me).
> 
> Someone should feel free to go ahead with that patch

Okay.

> but here's another
> possible avenue for improvement: don't ask for the directory when
> there's an existing vc-dir buffer, and it's for a parent of/or the
> current directory.
> 
> Just display it, maybe not even refresh until the user asks. That will
> cut some of the prompts overhead as well.

The ergonomics of sometimes prompting and sometimes not strike me as
potentially troublesome. Won't that lead to stray RETs in the vc-dir buffer?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-19  1:40   ` Dmitry Gutov
@ 2015-01-19 15:47     ` Dan Nicolaescu
  2015-01-19 23:17       ` Dmitry Gutov
  0 siblings, 1 reply; 49+ messages in thread
From: Dan Nicolaescu @ 2015-01-19 15:47 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Daniel Colascione, Emacs developers

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 01/11/2015 09:02 PM, Dan Nicolaescu wrote:
>
>> that behavior is not what SVN/CVS users want...
>
> Could you elaborate on that?

> From what I remember of working with SVN, there's not much difference
> from the modern VC systems, and you usually want to see the status of
> the whole repository.

CVS does not work on the root level.
Even in SVN, it's ok and desirable to just look at a subdirectory.

vc-dir has used the current directory since the beginning, I haven't
seen any request to change it until now, it doesn't seem like changing
the default behavior after so many years when there were no requests to
do it is a good idea just because someone sent a patch to change it.

vc-hg displays the "Root" in the vc-dir header.  The intention with that
was to make it a button that would display vc-dir on the top level
directory.
All backends (especially vc-git) should implement that Root header and
implement a button for it...




^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-19 14:57           ` Daniel Colascione
@ 2015-01-19 22:43             ` Dmitry Gutov
  0 siblings, 0 replies; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-19 22:43 UTC (permalink / raw)
  To: Daniel Colascione, Stefan Monnier; +Cc: Emacs developers

On 01/19/2015 04:57 PM, Daniel Colascione wrote:

> The ergonomics of sometimes prompting and sometimes not strike me as
> potentially troublesome. Won't that lead to stray RETs in the vc-dir buffer?

Hard to say.

Without your patch, it shouldn't (currently, there's not much 
expectation that vc-dir will open in the desired directory if you just 
press RET).

With your patch, possibly. But if the user only has to type that RET, on 
average, once per session, the reflex will probably fail to form. I 
don't think it'll be a problem for me, personally.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-19 15:47     ` Dan Nicolaescu
@ 2015-01-19 23:17       ` Dmitry Gutov
  2015-01-20 20:06         ` Dan Nicolaescu
  0 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-19 23:17 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Daniel Colascione, Emacs developers

On 01/19/2015 05:47 PM, Dan Nicolaescu wrote:

> CVS does not work on the root level.
> Even in SVN, it's ok and desirable to just look at a subdirectory.

Isn't that an implementation detail, as far as the current discussion is 
concerned? Git can also show only the status of files in a subdirectory, 
if you ask it.

> vc-dir has used the current directory since the beginning, I haven't
> seen any request to change it until now, it doesn't seem like changing
> the default behavior after so many years when there were no requests to
> do it is a good idea just because someone sent a patch to change it.

You've missed http://debbugs.gnu.org/12492, then. This patch also 
constitutes one request, obviously.

And you shouldn't forget that VC is not the most popular VCS package 
among advanced Emacs users, Magit is. We're playing catch-up.

> vc-hg displays the "Root" in the vc-dir header.  The intention with that
> was to make it a button that would display vc-dir on the top level
> directory.
> All backends (especially vc-git) should implement that Root header and
> implement a button for it...

That's an awkward proposal. To have to open vc-dir, then move my hand to 
the mouse, or point to the button, then push it...

Root is a good default, so vc-dir buffer for it should be easier to 
create than for a subdirectory.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-19 23:17       ` Dmitry Gutov
@ 2015-01-20 20:06         ` Dan Nicolaescu
  2015-01-21 14:33           ` Stefan Monnier
  0 siblings, 1 reply; 49+ messages in thread
From: Dan Nicolaescu @ 2015-01-20 20:06 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Daniel Colascione, Emacs developers

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 01/19/2015 05:47 PM, Dan Nicolaescu wrote:
>
>> CVS does not work on the root level.
>> Even in SVN, it's ok and desirable to just look at a subdirectory.
>
> Isn't that an implementation detail, as far as the current discussion
> is concerned? Git can also show only the status of files in a
> subdirectory, if you ask it.
>
>> vc-dir has used the current directory since the beginning, I haven't
>> seen any request to change it until now, it doesn't seem like changing
>> the default behavior after so many years when there were no requests to
>> do it is a good idea just because someone sent a patch to change it.
>
> You've missed http://debbugs.gnu.org/12492, then. This patch also
> constitutes one request, obviously.
> 
> And you shouldn't forget that VC is not the most popular VCS package
> among advanced Emacs users, Magit is. We're playing catch-up.
>
>> vc-hg displays the "Root" in the vc-dir header.  The intention with that
>> was to make it a button that would display vc-dir on the top level
>> directory.
>> All backends (especially vc-git) should implement that Root header and
>> implement a button for it...
>
> That's an awkward proposal. To have to open vc-dir, then move my hand
> to the mouse, or point to the button, then push it...

Buttons can be pressed with the keyboard.  That was just another way to
get to the root...

> Root is a good default, so vc-dir buffer for it should be easier to
> create than for a subdirectory.

It looks like root is a personal preference, there's still not much in
terms of solid arguments of why to change a long time default, and the
patch doesn't even give a way to get the current behavior, which most
people like.

You can make C-u C-x v d start vc-dir in the root directory.  Or you can
put the root directory in the history so that when C-x v d prompts for a
directory it's just a M-p away.  Or highlight the root in the path shown
by C-x v d.   These can be accomplished without removing the current
behavior. 



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-20 20:06         ` Dan Nicolaescu
@ 2015-01-21 14:33           ` Stefan Monnier
  2015-01-21 16:20             ` Ivan Shmakov
                               ` (2 more replies)
  0 siblings, 3 replies; 49+ messages in thread
From: Stefan Monnier @ 2015-01-21 14:33 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Daniel Colascione, Emacs developers, Dmitry Gutov

> It looks like root is a personal preference, there's still not much in
> terms of solid arguments of why to change a long time default, and the
> patch doesn't even give a way to get the current behavior, which most
> people like.

We don't really know what "most people like".  What we do know is that
the world of revision control has changed a lot since that code was
written: back then, there was simply no notion of "project root".

And since many operations in recent VCSes operate on the whole project,
I think it's very reasonable to assume that users will generally want to
see the whole project.

It's at least my case and Daniel's case.

We can provide the default-directory in M-n or something like that, but
Daniel's patch is good.


        Stefan



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 14:33           ` Stefan Monnier
@ 2015-01-21 16:20             ` Ivan Shmakov
  2015-01-21 17:33             ` Dan Nicolaescu
  2015-01-21 19:35             ` Wolfgang Jenkner
  2 siblings, 0 replies; 49+ messages in thread
From: Ivan Shmakov @ 2015-01-21 16:20 UTC (permalink / raw)
  To: Emacs developers

>>>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:

[…]

 > And since many operations in recent VCSes operate on the whole
 > project, I think it's very reasonable to assume that users will
 > generally want to see the whole project.

 > It's at least my case and Daniel's case.

 > We can provide the default-directory in M-n or something like that,

	Please do so.  TIA.

 > but Daniel's patch is good.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 14:33           ` Stefan Monnier
  2015-01-21 16:20             ` Ivan Shmakov
@ 2015-01-21 17:33             ` Dan Nicolaescu
  2015-01-21 17:48               ` Dmitry Gutov
  2015-01-21 19:35             ` Wolfgang Jenkner
  2 siblings, 1 reply; 49+ messages in thread
From: Dan Nicolaescu @ 2015-01-21 17:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Daniel Colascione, Emacs developers, Dmitry Gutov

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> It looks like root is a personal preference, there's still not much in
>> terms of solid arguments of why to change a long time default, and the
>> patch doesn't even give a way to get the current behavior, which most
>> people like.
>
> We don't really know what "most people like".  What we do know is that
> the world of revision control has changed a lot since that code was
> written: back then, there was simply no notion of "project root".

That's not quite true, I wrote vc-dir.el in 2007, mostly to deal better
with git and hg project, "project root" was quite well known at a time.

> And since many operations in recent VCSes operate on the whole project,
> I think it's very reasonable to assume that users will generally want to
> see the whole project.

That suffers from the same problem in our first paragraph...

> It's at least my case and Daniel's case.
>
> We can provide the default-directory in M-n or something like that, but
> Daniel's patch is good.

I strongly disagree.
I provided an alternative suggestion: make C-u C-x v d default to the
root directory, or something to put it in history.




^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 17:33             ` Dan Nicolaescu
@ 2015-01-21 17:48               ` Dmitry Gutov
  2015-01-21 18:22                 ` Ivan Shmakov
                                   ` (2 more replies)
  0 siblings, 3 replies; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-21 17:48 UTC (permalink / raw)
  To: Dan Nicolaescu, Stefan Monnier; +Cc: Daniel Colascione, Emacs developers

On 01/21/2015 07:33 PM, Dan Nicolaescu wrote:

>> We don't really know what "most people like".

We do know that a whole lot of people consider Magit to be the best 
thing since sliced bread. It does not provide such functionality, and I 
don't see anyone asking.

With prefix, it allows you to choose a different repository.

> That's not quite true, I wrote vc-dir.el in 2007, mostly to deal better
> with git and hg project, "project root" was quite well known at a time.

If the main purpose of vc-dir is to deal with modern systems better, we 
should better follow their conventions.

> I provided an alternative suggestion: make C-u C-x v d default to the
> root directory, or something to put it in history.

That's not good. 'C-u' should mean "I want to choose", and no prefix 
should mean "do the best possible thing", which is to use the repository 
root, since there's no obvious other choice.

I'd propose a patch like that, but vc-dir already changes behavior with 
prefix, and in a different way (allows to select the backend). Not sure 
how best to combine the two.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 17:48               ` Dmitry Gutov
@ 2015-01-21 18:22                 ` Ivan Shmakov
  2015-01-21 18:43                   ` Dmitry Gutov
  2015-01-21 18:47                 ` João Távora
  2015-01-22 15:19                 ` Dan Nicolaescu
  2 siblings, 1 reply; 49+ messages in thread
From: Ivan Shmakov @ 2015-01-21 18:22 UTC (permalink / raw)
  To: Emacs developers

>>>>> Dmitry Gutov <dgutov@yandex.ru> writes:
>>>>> On 01/21/2015 07:33 PM, Dan Nicolaescu wrote:

[…]

 >> I provided an alternative suggestion: make C-u C-x v d default to
 >> the root directory, or something to put it in history.

 > That's not good.  'C-u' should mean "I want to choose", and no prefix
 > should mean "do the best possible thing", which is to use the
 > repository root, since there's no obvious other choice.

	The obvious other choice is, obviously, to use default-directory.

 > I'd propose a patch like that, but vc-dir already changes behavior
 > with prefix, and in a different way (allows to select the backend).
 > Not sure how best to combine the two.

	I’d rather support the addition of a separate vc-root-dir
	command (as per http://debbugs.gnu.org/12492), especially given
	that we already have vc-root-diff and vc-print-root-log.

-- 
FSF associate member #7257  Zybex (Moody Malongo Mix) — Ahriakin  … 230E 334A



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 18:22                 ` Ivan Shmakov
@ 2015-01-21 18:43                   ` Dmitry Gutov
  2015-01-21 19:22                     ` Ivan Shmakov
  0 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-21 18:43 UTC (permalink / raw)
  To: Emacs developers

On 01/21/2015 08:22 PM, Ivan Shmakov wrote:

 > The obvious other choice is, obviously, to use default-directory.

Why default-directory and not any of its parents? If the repository root 
is not the right choice, we now have to guess which subtree of the 
repository the user is currently working on.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 17:48               ` Dmitry Gutov
  2015-01-21 18:22                 ` Ivan Shmakov
@ 2015-01-21 18:47                 ` João Távora
  2015-01-21 19:06                   ` Dmitry Gutov
  2015-01-22 15:19                 ` Dan Nicolaescu
  2 siblings, 1 reply; 49+ messages in thread
From: João Távora @ 2015-01-21 18:47 UTC (permalink / raw)
  To: Dmitry Gutov
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 01/21/2015 07:33 PM, Dan Nicolaescu wrote:
>
>>> We don't really know what "most people like".
> We do know that a whole lot of people consider Magit to be the best
> thing since sliced bread. It does not provide such functionality, and
> I don't see anyone asking.

I understand this is not (yet?) a vote, but wanted nevertheless to show
my support for Daniel and Stefan's idea (also I really really don't
consider Magit to be that good).

In my perspective, in Git, it almost never makes sense to `vc-dir' into
anything but the root directory. AFAIK there is no git-status for
subdirectories (unless they are a submodule), and I see `vc-dir' as an
interactive substitute for git-status. More practically, among other
annoyances, it is especially annoying when `M-x vc-dir' opens in a
subdir and I press `v' to commit marked files. In that occasion, the
contents of the transient (or file-based, in the case of Emacs itself)
ChangeLog buffers, which are conveniently and automatically transported
into the VC-log buffer, happens incorrectly, omitting the full path that
is the convention.

So, may I ask what is the trouble with making this option depend on the
current visited file's `vc-backend`? CVS and others could default to
default-directory and Git and others could default to the root
directory.

João



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 18:47                 ` João Távora
@ 2015-01-21 19:06                   ` Dmitry Gutov
  2015-01-21 20:14                     ` João Távora
  0 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-21 19:06 UTC (permalink / raw)
  To: João Távora
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

On 01/21/2015 08:47 PM, joaotavora@gmail.com (João Távora) wrote:

> AFAIK there is no git-status for subdirectories (unless they are a submodule)

git status -- path/to/subdirectory

seems to work fine for this. Or

git status -- .

if you're already there.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 18:43                   ` Dmitry Gutov
@ 2015-01-21 19:22                     ` Ivan Shmakov
  0 siblings, 0 replies; 49+ messages in thread
From: Ivan Shmakov @ 2015-01-21 19:22 UTC (permalink / raw)
  To: Emacs developers

>>>>> Dmitry Gutov <dgutov@yandex.ru> writes:
>>>>> On 01/21/2015 08:22 PM, Ivan Shmakov wrote:

 >> The obvious other choice is, obviously, to use default-directory.

 > Why default-directory and not any of its parents?

	Are there any other Emacs commands applying read-directory-name
	to something other than default-directory?

	Anyway, the ‘default-dirname’ argument to read-directory-name
	can be a list; the first two elements would be default-directory
	and vc-root (preferably in a customizable order; but personally,
	– I can live up with either), with the rest being the
	intermediates.  All win, no?

 > If the repository root is not the right choice, we now have to guess
 > which subtree of the repository the user is currently working on.

	Or the user can specify it explicitly; in particular, – by
	choosing the right one from the ‘default-dirname’ list.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 14:33           ` Stefan Monnier
  2015-01-21 16:20             ` Ivan Shmakov
  2015-01-21 17:33             ` Dan Nicolaescu
@ 2015-01-21 19:35             ` Wolfgang Jenkner
  2015-01-21 19:42               ` Daniel Colascione
  2 siblings, 1 reply; 49+ messages in thread
From: Wolfgang Jenkner @ 2015-01-21 19:35 UTC (permalink / raw)
  To: Stefan Monnier
  Cc: Dan Nicolaescu, Daniel Colascione, Dmitry Gutov, Emacs developers

On Wed, Jan 21 2015, Stefan Monnier wrote:

> We can provide the default-directory in M-n or something like that, but
> Daniel's patch is good.

What about the following patch, which would also provide that behaviour
while making it obvious how to work around this regr^H^H^H^H new feature
in a not too inconvenient way and get the current behaviour back, viz.,
by using C-k to kill all trailing "../" components.

Wolfgang

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 8bba79c..b6352e4 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1241,8 +1241,10 @@ These are the commands available for use in the file status buffer:
     ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d
     ;; you may get a new *vc-dir* buffer, different from the original
     (file-truename (read-directory-name "VC status for directory: "
-					default-directory default-directory t
-					nil))
+					default-directory nil t
+					(when-let ((root (vc-root-dir)))
+					  (file-relative-name root
+							      default-directory))))
     (if current-prefix-arg
 	(intern
 	 (completing-read



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 19:35             ` Wolfgang Jenkner
@ 2015-01-21 19:42               ` Daniel Colascione
  2015-01-21 20:16                 ` Stefan Monnier
                                   ` (2 more replies)
  0 siblings, 3 replies; 49+ messages in thread
From: Daniel Colascione @ 2015-01-21 19:42 UTC (permalink / raw)
  To: Stefan Monnier, Dan Nicolaescu, Emacs developers, Dmitry Gutov

[-- Attachment #1: Type: text/plain, Size: 663 bytes --]

On 01/21/2015 11:35 AM, Wolfgang Jenkner wrote:
> On Wed, Jan 21 2015, Stefan Monnier wrote:
> 
>> We can provide the default-directory in M-n or something like that, but
>> Daniel's patch is good.
> 
> What about the following patch, which would also provide that behaviour
> while making it obvious how to work around this regr^H^H^H^H new feature
> in a not too inconvenient way and get the current behaviour back, viz.,
> by using C-k to kill all trailing "../" components.

That seems like it'd confuse users. Are we okay with just repurposing
the prefix argument? Does anyone actually use the existing ability to
force a particular backend?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 19:06                   ` Dmitry Gutov
@ 2015-01-21 20:14                     ` João Távora
  2015-01-21 20:30                       ` Dmitry Gutov
  0 siblings, 1 reply; 49+ messages in thread
From: João Távora @ 2015-01-21 20:14 UTC (permalink / raw)
  To: Dmitry Gutov
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

Dmitry Gutov <dgutov@yandex.ru> writes:

>> AFAIK there is no git-status for subdirectories (unless they are a submodule)
>
> git status -- path/to/subdirectory
>
> seems to work fine for this. Or
>
> git status -- .
>
> if you're already there.

Thanks, I stand corrected (and hence the AFAIK). But then, isn't this an
argument for following Git's default behaviour of using the root dir??

João



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 19:42               ` Daniel Colascione
@ 2015-01-21 20:16                 ` Stefan Monnier
  2015-01-22  9:59                   ` Daniel Colascione
  2015-01-22  1:44                 ` Dmitry Gutov
  2015-01-22 16:11                 ` Wolfgang Jenkner
  2 siblings, 1 reply; 49+ messages in thread
From: Stefan Monnier @ 2015-01-21 20:16 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Dan Nicolaescu, Dmitry Gutov, Emacs developers

> That seems like it'd confuse users. Are we okay with just repurposing
> the prefix argument?

Fine by me.


        Stefan



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 20:14                     ` João Távora
@ 2015-01-21 20:30                       ` Dmitry Gutov
  2015-01-22 12:40                         ` João Távora
  0 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-21 20:30 UTC (permalink / raw)
  To: João Távora
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

On 01/21/2015 10:14 PM, joaotavora@gmail.com (João Távora) wrote:

> Thanks, I stand corrected (and hence the AFAIK). But then, isn't this an
> argument for following Git's default behaviour of using the root dir??

One can look at it in different ways, but I consider it an argument 
against CVS and SVN being special snowflakes.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 19:42               ` Daniel Colascione
  2015-01-21 20:16                 ` Stefan Monnier
@ 2015-01-22  1:44                 ` Dmitry Gutov
  2015-01-22  9:17                   ` Andreas Schwab
  2015-01-22 16:11                 ` Wolfgang Jenkner
  2 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-22  1:44 UTC (permalink / raw)
  To: Daniel Colascione, Stefan Monnier, Dan Nicolaescu,
	Emacs developers

On 01/21/2015 09:42 PM, Daniel Colascione wrote:
> Does anyone actually use the existing ability to
> force a particular backend?

Probably not, but the ability makes sense: how else to open vc-dir using 
a specific backend in a multi-VCS directory? Those are possible.

I'd relegate it to C-u C-u, though. So if the numeric argument is 4, 
just ask for the directory (defaulting to default-directory, I'd say). 
If it's 16, then ask for the backend and the directory.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22  1:44                 ` Dmitry Gutov
@ 2015-01-22  9:17                   ` Andreas Schwab
  2015-01-22 11:14                     ` Dmitry Gutov
  2015-01-22 14:18                     ` Stefan Monnier
  0 siblings, 2 replies; 49+ messages in thread
From: Andreas Schwab @ 2015-01-22  9:17 UTC (permalink / raw)
  To: Dmitry Gutov
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

What's wrong with putting the other directory in the history, for
retrieval by M-n?  That way you have the best of both worlds without
having to remember before starting the command.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 20:16                 ` Stefan Monnier
@ 2015-01-22  9:59                   ` Daniel Colascione
  0 siblings, 0 replies; 49+ messages in thread
From: Daniel Colascione @ 2015-01-22  9:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Dan Nicolaescu, Emacs developers, Dmitry Gutov

[-- Attachment #1: Type: text/plain, Size: 2288 bytes --]

On 01/21/2015 12:16 PM, Stefan Monnier wrote:
>> That seems like it'd confuse users. Are we okay with just repurposing
>> the prefix argument?
> 
> Fine by me.

I like the idea of using prefix argument repetition to select the
arguments for which we'd like to prompt. How's this?

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index e050c94..c5fbcf6 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1227,7 +1227,10 @@ first appears, it has only the first few lines of
summary information.
 The file lines appear later.

 Optional second argument BACKEND specifies the VC backend to use.
-Interactively, a prefix argument means to ask for the backend.
+Interactively, display the repository root.  A single prefix
+argument means to ask for the root directory, defaulting to
+`default-directory'.  A duplicated default prefix argument (e.g.,
+C-u C-u) means to ask for the VC back-end as well.

 These are the commands available for use in the file status buffer:

@@ -1240,16 +1243,20 @@ These are the commands available for use in the
file status buffer:
     ;; therefore it makes sense to always do that.
     ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d
     ;; you may get a new *vc-dir* buffer, different from the original
-    (file-truename (read-directory-name "VC status for directory: "
-					(vc-root-dir) nil t
-					nil))
     (if current-prefix-arg
-	(intern
-	 (completing-read
-	  "Use VC backend: "
-	  (mapcar (lambda (b) (list (symbol-name b)))
-		  vc-handled-backends)
-	  nil t nil nil)))))
+        (file-truename (read-directory-name "VC status for directory: "
+                                            default-directory
default-directory t
+                                            nil))
+      (vc-root-dir))
+    (when (and (consp current-prefix-arg)
+               (null (cdr current-prefix-arg))
+               (> (car current-prefix-arg) 4))
+      (intern
+       (completing-read
+        "Use VC backend: "
+        (mapcar (lambda (b) (list (symbol-name b)))
+                vc-handled-backends)
+        nil t nil nil)))))
   (unless backend
     (setq backend (vc-responsible-backend dir)))
   (let (pop-up-windows)		      ; based on cvs-examine; bug#6204



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22  9:17                   ` Andreas Schwab
@ 2015-01-22 11:14                     ` Dmitry Gutov
  2015-01-22 12:04                       ` Jan D.
  2015-01-22 14:18                     ` Stefan Monnier
  1 sibling, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-22 11:14 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

On 01/22/2015 11:17 AM, Andreas Schwab wrote:
> What's wrong with putting the other directory in the history, for
> retrieval by M-n?  That way you have the best of both worlds without
> having to remember before starting the command.

IME, `M-n' used like this is a pretty obscure feature.

Anyway, vc-dir with Daniel's latest patch should be easy to advice to 
effectively reverse the change, if you don't like it.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 11:14                     ` Dmitry Gutov
@ 2015-01-22 12:04                       ` Jan D.
  0 siblings, 0 replies; 49+ messages in thread
From: Jan D. @ 2015-01-22 12:04 UTC (permalink / raw)
  To: Dmitry Gutov, Andreas Schwab
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

Dmitry Gutov skrev den 2015-01-22 12:14:
> On 01/22/2015 11:17 AM, Andreas Schwab wrote:
>> What's wrong with putting the other directory in the history, for
>> retrieval by M-n?  That way you have the best of both worlds without
>> having to remember before starting the command.
>
> IME, `M-n' used like this is a pretty obscure feature.

It is used for C-x C-f.  The current filename is put there.
I think it would be a good solution.

	Jan D.




^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 20:30                       ` Dmitry Gutov
@ 2015-01-22 12:40                         ` João Távora
  0 siblings, 0 replies; 49+ messages in thread
From: João Távora @ 2015-01-22 12:40 UTC (permalink / raw)
  To: Dmitry Gutov
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 01/21/2015 10:14 PM, joaotavora@gmail.com (João Távora) wrote:
>
>> But then, isn't this an argument for following Git's default
>> behaviour of using the root dir??
>
> One can look at it in different ways, but I consider it an argument
> against CVS and SVN being special snowflakes.

How so? If the default behaviour of "svn status" and "git status"
differ, shouldn't vc-dir follow those defaults according to the backend,
so that it does-what-we-mean with a better chance? Isn't DWIM the idea
behind other commands like `vc-next-action` and such?

Wouldn't this appease the people who oppose this change because they use
CVS/SVN? Attached is a (slightly untested) patch to do this, in case I
am not making myself clear.

diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index c1d32ce..e75dcb3 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -770,6 +770,10 @@ If UPDATE is non-nil, then update (resynch) any affected buffers."
     (re-search-forward "\\$[A-Za-z\300-\326\330-\366\370-\377]+\
 \\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t)))
 
+(defun vc-cvs-default-status-dir ()
+  "For CVS, `vc-dir' should default to the current directory"
+  default-directory)
+
 
 ;;;
 ;;; Internal functions
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index c90bf1c..0644909 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1215,6 +1215,17 @@ state of item at point, if any."
 	(setq model (vc-checkout-model vc-dir-backend only-files-list))))
     (list vc-dir-backend files only-files-list state model)))
 
+(defun vc-dir-default-status-dir ()
+  "Provide a good default value for `vc-dir' prompt.
+Defaults to `vc-root-dir' if the backend doesn't implement this function."
+  (let ((backend (vc-deduce-backend)))
+    (if backend
+        (condition-case _err
+            (vc-call-backend backend 'default-status-dir)
+          (error
+           (vc-root-dir)))
+      (vc-root-dir))))
+
 ;;;###autoload
 (defun vc-dir (dir &optional backend)
   "Show the VC status for \"interesting\" files in and below DIR.
@@ -1241,7 +1252,7 @@ These are the commands available for use in the file status buffer:
     ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d
     ;; you may get a new *vc-dir* buffer, different from the original
     (file-truename (read-directory-name "VC status for directory: "
-					default-directory default-directory t
+					(vc-dir-default-status-dir) nil t
 					nil))
     (if current-prefix-arg
 	(intern
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 5c87cab..80b12ea 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -256,6 +256,10 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
                newrev)
       (number-to-string newrev))))
 
+(defun vc-svn-default-status-dir ()
+  "For SVN, `vc-dir' should default to the current directory"
+  default-directory)
+
 
 ;;;
 ;;; State-changing functions





^ permalink raw reply related	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22  9:17                   ` Andreas Schwab
  2015-01-22 11:14                     ` Dmitry Gutov
@ 2015-01-22 14:18                     ` Stefan Monnier
  2015-01-22 14:23                       ` Dmitry Gutov
  1 sibling, 1 reply; 49+ messages in thread
From: Stefan Monnier @ 2015-01-22 14:18 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Dan Nicolaescu, Daniel Colascione, Emacs developers, Dmitry Gutov

> What's wrong with putting the other directory in the history, for
> retrieval by M-n?  That way you have the best of both worlds without
> having to remember before starting the command.

Agreed.


        Stefan



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 14:18                     ` Stefan Monnier
@ 2015-01-22 14:23                       ` Dmitry Gutov
  2015-01-22 14:38                         ` Andreas Schwab
  2015-01-22 14:45                         ` Ivan Shmakov
  0 siblings, 2 replies; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-22 14:23 UTC (permalink / raw)
  To: Stefan Monnier, Andreas Schwab
  Cc: Dan Nicolaescu, Daniel Colascione, Emacs developers

On 01/22/2015 04:18 PM, Stefan Monnier wrote:
>> What's wrong with putting the other directory in the history, for
>> retrieval by M-n?  That way you have the best of both worlds without
>> having to remember before starting the command.
>
> Agreed.

Okay, what "other directory"?

And ido-find-file binds `M-n' to a totally different command.

Whatever you may think of this mode, it means that a lot of users are 
unfamiliar with that use of `M-n'.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 14:23                       ` Dmitry Gutov
@ 2015-01-22 14:38                         ` Andreas Schwab
  2015-01-22 14:46                           ` Dmitry Gutov
  2015-01-22 14:45                         ` Ivan Shmakov
  1 sibling, 1 reply; 49+ messages in thread
From: Andreas Schwab @ 2015-01-22 14:38 UTC (permalink / raw)
  To: Dmitry Gutov
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 01/22/2015 04:18 PM, Stefan Monnier wrote:
>>> What's wrong with putting the other directory in the history, for
>>> retrieval by M-n?  That way you have the best of both worlds without
>>> having to remember before starting the command.
>>
>> Agreed.
>
> Okay, what "other directory"?

Either the repository root or the default directory, whatever isn't the
default.

> Whatever you may think of this mode, it means that a lot of users are
> unfamiliar with that use of `M-n'.

Everyone has used the history.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 14:23                       ` Dmitry Gutov
  2015-01-22 14:38                         ` Andreas Schwab
@ 2015-01-22 14:45                         ` Ivan Shmakov
  2015-01-22 14:49                           ` Dmitry Gutov
  1 sibling, 1 reply; 49+ messages in thread
From: Ivan Shmakov @ 2015-01-22 14:45 UTC (permalink / raw)
  To: Emacs developers

>>>>> Dmitry Gutov <dgutov@yandex.ru> writes:

[…]

 > And ido-find-file binds `M-n' to a totally different command.

	… Yet it still leaves ‘down’ bound to just the same good old
	next-line-or-history-element.

[…]

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 14:38                         ` Andreas Schwab
@ 2015-01-22 14:46                           ` Dmitry Gutov
  2015-01-22 15:30                             ` Drew Adams
  2015-01-22 15:40                             ` Andreas Schwab
  0 siblings, 2 replies; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-22 14:46 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

On 01/22/2015 04:38 PM, Andreas Schwab wrote:

>> Whatever you may think of this mode, it means that a lot of users are
>> unfamiliar with that use of `M-n'.
>
> Everyone has used the history.

Putting a value in history that the user has never put in themselves 
means overloading the term "history".

I'm not that strongly opposed to this approach as long as root will be 
the default, but the C-u/C-uC-u approach looks a lot more appealing, and 
it'll save a keystroke.

Also, C-u and M-n are more or less equally easy to press.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 14:45                         ` Ivan Shmakov
@ 2015-01-22 14:49                           ` Dmitry Gutov
  2015-01-22 15:50                             ` Ivan Shmakov
  0 siblings, 1 reply; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-22 14:49 UTC (permalink / raw)
  To: Emacs developers

On 01/22/2015 04:45 PM, Ivan Shmakov wrote:

>   > And ido-find-file binds `M-n' to a totally different command.
>
> 	… Yet it still leaves ‘down’ bound to just the same good old
> 	next-line-or-history-element.

Does it?

...<down> runs the command ido-next-match-dir...

Check out the definition of ido-file-dir-completion-map.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 17:48               ` Dmitry Gutov
  2015-01-21 18:22                 ` Ivan Shmakov
  2015-01-21 18:47                 ` João Távora
@ 2015-01-22 15:19                 ` Dan Nicolaescu
  2 siblings, 0 replies; 49+ messages in thread
From: Dan Nicolaescu @ 2015-01-22 15:19 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Daniel Colascione, Stefan Monnier, Emacs developers

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 01/21/2015 07:33 PM, Dan Nicolaescu wrote:
>
>>> We don't really know what "most people like".
>
> We do know that a whole lot of people consider Magit to be the best
> thing since sliced bread. It does not provide such functionality, and
> I don't see anyone asking.
>
> With prefix, it allows you to choose a different repository.
>
>> That's not quite true, I wrote vc-dir.el in 2007, mostly to deal better
>> with git and hg project, "project root" was quite well known at a time.
>
> If the main purpose of vc-dir is to deal with modern systems better,
> we should better follow their conventions.

The proposal is taking away a feature that some people like (including
myself).  Simply taking away something that has been available from day 1
without considering offering alternatives is not nice to users.  Appeals
to authority, or talking about "modern" do not hold any water in such cases.

Please reconsider your approach.

I've already provided 3 alternatives that can help provide what you
desire: use a "Root" header, put the root directory in the history or
use C-u C-x v d.   Or do something else even better...



^ permalink raw reply	[flat|nested] 49+ messages in thread

* RE: vc-dir default directory: repository root?
  2015-01-22 14:46                           ` Dmitry Gutov
@ 2015-01-22 15:30                             ` Drew Adams
  2015-01-22 16:16                               ` Dmitry Gutov
  2015-01-22 15:40                             ` Andreas Schwab
  1 sibling, 1 reply; 49+ messages in thread
From: Drew Adams @ 2015-01-22 15:30 UTC (permalink / raw)
  To: Dmitry Gutov, Andreas Schwab
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

> Putting a value in history that the user has never put in themselves
> means overloading the term "history".

Wow, flash from the past!  I offered that argument long ago.
But that ship sailed nearly as long ago.

`M-n' has long (now) meant either move forward in the history or
move forward among a list of default values.  IOW, Emacs has
prepended multiple default values to the history list for a long
time.

And this behavior is handy - my argument still makes sense, but
it is not the only consideration.

What might be even better would be some (optional) visual
indication when you cross the threshold between past inputs
and default values. IOW, make clear whether a given entry was
a past input or is a suggested (default) value.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 14:46                           ` Dmitry Gutov
  2015-01-22 15:30                             ` Drew Adams
@ 2015-01-22 15:40                             ` Andreas Schwab
  1 sibling, 0 replies; 49+ messages in thread
From: Andreas Schwab @ 2015-01-22 15:40 UTC (permalink / raw)
  To: Dmitry Gutov
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

Dmitry Gutov <dgutov@yandex.ru> writes:

> Also, C-u and M-n are more or less equally easy to press.

Reversing C-u requires aborting the command.  With the history you can
switch between the options back and forth with a single key.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 14:49                           ` Dmitry Gutov
@ 2015-01-22 15:50                             ` Ivan Shmakov
  2015-01-22 16:26                               ` Dmitry Gutov
  0 siblings, 1 reply; 49+ messages in thread
From: Ivan Shmakov @ 2015-01-22 15:50 UTC (permalink / raw)
  To: Emacs developers

>>>>> Dmitry Gutov <dgutov@yandex.ru> writes:
>>>>> On 01/22/2015 04:45 PM, Ivan Shmakov wrote:

 >>> And ido-find-file binds `M-n' to a totally different command.

 >> … Yet it still leaves ‘down’ bound to just the same good old
 >> next-line-or-history-element.

 > Does it?

 > ...<down> runs the command ido-next-match-dir...

 > Check out the definition of ido-file-dir-completion-map.

	I’m unfamiliar with ido.el, so I’ve indeed missed the
	(ido-mode 'file) part.

	Now, do I understand it correctly that no minibuffer history is
	available with ido?

	Anyway, given that vc-dir (AIUI) has never been altered by
	ido-mode, and given that there’re a fair share of commands never
	touched by that (M-x and M-: come to mind), I still expect for
	the users to be generally familiar with the usual history
	navigation commands and bindings.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-21 19:42               ` Daniel Colascione
  2015-01-21 20:16                 ` Stefan Monnier
  2015-01-22  1:44                 ` Dmitry Gutov
@ 2015-01-22 16:11                 ` Wolfgang Jenkner
  2 siblings, 0 replies; 49+ messages in thread
From: Wolfgang Jenkner @ 2015-01-22 16:11 UTC (permalink / raw)
  To: Daniel Colascione
  Cc: Dan Nicolaescu, Dmitry Gutov, Stefan Monnier, Emacs developers

On Wed, Jan 21 2015, Daniel Colascione wrote:

> On 01/21/2015 11:35 AM, Wolfgang Jenkner wrote:

>> What about the following patch, which would also provide that behaviour
>> while making it obvious how to work around this regr^H^H^H^H new feature
>> in a not too inconvenient way and get the current behaviour back, viz.,
>> by using C-k to kill all trailing "../" components.
>
> That seems like it'd confuse users.

That's because it's more natural to do things the other way around,
IMHO, keeping the current default but making it as convenient as
possible to get rid of the file name components after the repo root.

That's quite similar to the way GTK widgets for selecting things work,
so it won't confuse people too much, I think.

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 8bba79c..d7c6e97 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1240,9 +1240,12 @@ These are the commands available for use in the file status buffer:
     ;; therefore it makes sense to always do that.
     ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d
     ;; you may get a new *vc-dir* buffer, different from the original
-    (file-truename (read-directory-name "VC status for directory: "
-					default-directory default-directory t
-					nil))
+    (file-truename (let ((root (vc-root-dir)))
+		     (read-directory-name "VC status for directory: "
+					  root nil t
+					  (when root
+					    (file-relative-name default-directory
+							      root)))))
     (if current-prefix-arg
 	(intern
 	 (completing-read




^ permalink raw reply related	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 15:30                             ` Drew Adams
@ 2015-01-22 16:16                               ` Dmitry Gutov
  0 siblings, 0 replies; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-22 16:16 UTC (permalink / raw)
  To: Drew Adams, Andreas Schwab
  Cc: Dan Nicolaescu, Daniel Colascione, Stefan Monnier,
	Emacs developers

On 01/22/2015 05:30 PM, Drew Adams wrote:

> `M-n' has long (now) meant either move forward in the history or
> move forward among a list of default values.  IOW, Emacs has
> prepended multiple default values to the history list for a long
> time.

Maybe so. My argument was against "everyone has used the history", which 
may be true, but doesn't mean that everyone knows about this M-n behavior.

It has pretty poor discoverability, so maybe it shouldn't be relied on 
for important features.



^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: vc-dir default directory: repository root?
  2015-01-22 15:50                             ` Ivan Shmakov
@ 2015-01-22 16:26                               ` Dmitry Gutov
  0 siblings, 0 replies; 49+ messages in thread
From: Dmitry Gutov @ 2015-01-22 16:26 UTC (permalink / raw)
  To: Emacs developers

On 01/22/2015 05:50 PM, Ivan Shmakov wrote:

> 	Anyway, given that vc-dir (AIUI) has never been altered by
> 	ido-mode,

It is, when `ido-everywhere' is also on.



^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2015-01-22 16:26 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-10  6:52 vc-dir default directory: repository root? Daniel Colascione
2015-01-11  1:26 ` Stefan Monnier
2015-01-11  8:33 ` Andreas Schwab
2015-01-11 15:53 ` Wolfgang Jenkner
2015-01-11 19:02 ` Dan Nicolaescu
2015-01-19  1:40   ` Dmitry Gutov
2015-01-19 15:47     ` Dan Nicolaescu
2015-01-19 23:17       ` Dmitry Gutov
2015-01-20 20:06         ` Dan Nicolaescu
2015-01-21 14:33           ` Stefan Monnier
2015-01-21 16:20             ` Ivan Shmakov
2015-01-21 17:33             ` Dan Nicolaescu
2015-01-21 17:48               ` Dmitry Gutov
2015-01-21 18:22                 ` Ivan Shmakov
2015-01-21 18:43                   ` Dmitry Gutov
2015-01-21 19:22                     ` Ivan Shmakov
2015-01-21 18:47                 ` João Távora
2015-01-21 19:06                   ` Dmitry Gutov
2015-01-21 20:14                     ` João Távora
2015-01-21 20:30                       ` Dmitry Gutov
2015-01-22 12:40                         ` João Távora
2015-01-22 15:19                 ` Dan Nicolaescu
2015-01-21 19:35             ` Wolfgang Jenkner
2015-01-21 19:42               ` Daniel Colascione
2015-01-21 20:16                 ` Stefan Monnier
2015-01-22  9:59                   ` Daniel Colascione
2015-01-22  1:44                 ` Dmitry Gutov
2015-01-22  9:17                   ` Andreas Schwab
2015-01-22 11:14                     ` Dmitry Gutov
2015-01-22 12:04                       ` Jan D.
2015-01-22 14:18                     ` Stefan Monnier
2015-01-22 14:23                       ` Dmitry Gutov
2015-01-22 14:38                         ` Andreas Schwab
2015-01-22 14:46                           ` Dmitry Gutov
2015-01-22 15:30                             ` Drew Adams
2015-01-22 16:16                               ` Dmitry Gutov
2015-01-22 15:40                             ` Andreas Schwab
2015-01-22 14:45                         ` Ivan Shmakov
2015-01-22 14:49                           ` Dmitry Gutov
2015-01-22 15:50                             ` Ivan Shmakov
2015-01-22 16:26                               ` Dmitry Gutov
2015-01-22 16:11                 ` Wolfgang Jenkner
2015-01-19  1:38 ` Dmitry Gutov
2015-01-19  3:01   ` Stefan Monnier
2015-01-19  4:54     ` Dmitry Gutov
2015-01-19 14:16       ` Stefan Monnier
2015-01-19 14:55         ` Dmitry Gutov
2015-01-19 14:57           ` Daniel Colascione
2015-01-19 22:43             ` Dmitry Gutov

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).