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: Wed, 21 Jan 2015 20:35:19 +0100 Message-ID: <85sif3zzwp.fsf@iznogoud.viz> References: <54B0CC33.2050100@dancol.org> <54BC60A8.6040401@yandex.ru> <54BD9071.5070802@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421869200 19835 80.91.229.3 (21 Jan 2015 19:40:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2015 19:40:00 +0000 (UTC) Cc: Dan Nicolaescu , Daniel Colascione , Dmitry Gutov , Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 21 20:39:58 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 1YE189-0001uB-PY for ged-emacs-devel@m.gmane.org; Wed, 21 Jan 2015 20:39:57 +0100 Original-Received: from localhost ([::1]:49922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YE189-0005mO-9L for ged-emacs-devel@m.gmane.org; Wed, 21 Jan 2015 14:39:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YE17u-0005m8-Gp for emacs-devel@gnu.org; Wed, 21 Jan 2015 14:39:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YE17r-0008JW-B3 for emacs-devel@gnu.org; Wed, 21 Jan 2015 14:39:42 -0500 Original-Received: from b2bfep14.mx.upcmail.net ([62.179.121.59]:44113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YE17r-0008I6-0t for emacs-devel@gnu.org; Wed, 21 Jan 2015 14:39:39 -0500 Original-Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep14.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150121193937.JWDQ11972.b2bfep14-int.chello.at@edge12.upcmail.net> for ; Wed, 21 Jan 2015 20:39:37 +0100 Original-Received: from iznogoud.viz ([91.119.93.79]) by edge12.upcmail.net with edge id ijfa1p00H1ikUB70CjfaeK; Wed, 21 Jan 2015 20:39:35 +0100 X-SourceIP: 91.119.93.79 Original-Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1YE17m-0000qs-En; Wed, 21 Jan 2015 20:39:34 +0100 Mail-Followup-To: Stefan Monnier , Dan Nicolaescu , Daniel Colascione , 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.59 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:181518 Archived-At: 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