From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.devel Subject: Re: vc-dir default directory: repository root? Date: Thu, 22 Jan 2015 17:11:25 +0100 Message-ID: <85fvb2pz6b.fsf@iznogoud.viz> References: <54B0CC33.2050100@dancol.org> <54BC60A8.6040401@yandex.ru> <54BD9071.5070802@yandex.ru> <85sif3zzwp.fsf@iznogoud.viz> <54C0013C.7070601@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421943491 6980 80.91.229.3 (22 Jan 2015 16:18:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2015 16:18:11 +0000 (UTC) Cc: Dan Nicolaescu , Dmitry Gutov , Stefan Monnier , Emacs developers To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 22 17:18:10 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YEKSK-0003NF-Ts for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 17:18:05 +0100 Original-Received: from localhost ([::1]:54657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEKSK-0005eQ-7v for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 11:18:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEKSG-0005eK-LE for emacs-devel@gnu.org; Thu, 22 Jan 2015 11:18:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEKS7-0005dg-Sc for emacs-devel@gnu.org; Thu, 22 Jan 2015 11:18:00 -0500 Original-Received: from b2bfep12.mx.upcmail.net ([62.179.121.57]:55427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEKS7-0005a2-HR for emacs-devel@gnu.org; Thu, 22 Jan 2015 11:17:51 -0500 Original-Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep12.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150122161749.EWVX14748.b2bfep12-int.chello.at@edge11.upcmail.net> for ; Thu, 22 Jan 2015 17:17:49 +0100 Original-Received: from iznogoud.viz ([91.119.135.106]) by edge11.upcmail.net with edge id j4Ho1p00i2HuMtX0B4Hptf; Thu, 22 Jan 2015 17:17:49 +0100 X-SourceIP: 91.119.135.106 Original-Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YEKS4-0006Hp-Rk; Thu, 22 Jan 2015 17:17:48 +0100 Mail-Followup-To: Daniel Colascione , Stefan Monnier , Dan Nicolaescu , Emacs developers , Dmitry Gutov User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 62.179.121.57 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181618 Archived-At: 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