From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: vc-dir default directory: repository root? Date: Thu, 22 Jan 2015 01:59:30 -0800 Message-ID: <54C0CA02.4050406@dancol.org> 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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0Df5iGewtLlnCAvOx2xO1tjpSFt5X1tVN" X-Trace: ger.gmane.org 1421920780 2778 80.91.229.3 (22 Jan 2015 09:59:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2015 09:59:40 +0000 (UTC) Cc: Dan Nicolaescu , Emacs developers , Dmitry Gutov To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 22 10:59:39 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 1YEEY7-0007no-Fh for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 10:59:39 +0100 Original-Received: from localhost ([::1]:52081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEEY6-000341-VN for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 04:59:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEEY2-00032Y-RL for emacs-devel@gnu.org; Thu, 22 Jan 2015 04:59:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEEY1-0006tr-T1 for emacs-devel@gnu.org; Thu, 22 Jan 2015 04:59:34 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:60313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEEY1-0006tc-Lh; Thu, 22 Jan 2015 04:59:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=mX5ZpexWfRqtilXcOn1gZGRGfoZNVdeiexYXGzgXme0=; b=JVLfAbG2indW0dPXQ4svKpfZYgsWPYLFIhtm80b2nKFhnib9gOpLN7+M2EPwf5tCTFHa2FtrfYEnuSONsnbFvpA/UDBoE3fQppVDJKJhLvuCUC2rFUOSATVuqXraV6Y3X0QXh9NVq43EdTagGaafCHT2kMg5lZ7s4KMyHoN6H15/55g3dHhN8Lhoiu3WW+BOUMWVYC71BNlBNQ9XuQwxLuQ2bh2dakv81fhaJSaQMHyvj8QT5XiA1xKGpPLQ+MagJGMcjPME/dy7ip2XL0FZael/kBwg8dT0tk/9Fxiq0vy+DrQvNAf/NNo363Dc2n8YJmWjFtLSiz8ULDcQ5oSM4Q==; Original-Received: from [2601:8:b240:93::2b1] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YEEXz-00008I-QQ; Thu, 22 Jan 2015 01:59:31 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 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:181575 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0Df5iGewtLlnCAvOx2xO1tjpSFt5X1tVN Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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? >=20 > 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 --0Df5iGewtLlnCAvOx2xO1tjpSFt5X1tVN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJUwMoCAAoJEN4WImmbpWBlX8UP/ixy4aKU1BsOX7CVN94KH5jK rygRsmixONkN54Kf4VpdOztwDP9aQ6NxX3gaIJew62sK+ROi4Htf+iugelQxTVmR dpD1NQ9YCux4GImo7aSV4ry16m657PkIX2NnEys6DZFICKAZuynFELkWNXMZuPFy BT1VB1Y6ZjtiI9BwIXm9c3i7q7wVgzvCLqOFNUmQRUACo2BWbVlApc30ZDhUKiSk RN3XFFy7fXhfzSXESYfGShYnEW2A36B5bwfMPmnZelCI/IHT87RpTRT3BdK0fJv7 W70Srltj8XVzyJMeMwYA4CKGjLZsNvjv1kXilkvJQDFwnWjK1Ah4hVO8VPz99Ud5 z5c+kaZ2P/AXwbpz1AUdb9hqw1rl5dL+f3g89s3AfZsgdnfuF/UPwfDr+x7Yl+Uz hgICBxsa6TFsY7wuHRUKjue4AllhMjpI72kHyce5SHkMiop+WAiL8Z3Fx1zHwY4N E7W5oM7DpDDhiWxFoUQT8E8FOO6P3MfvVzKLsL1lwTCM1uhIWi2WKpM7f0zKAoJF lf19kTFNe5dEpO6Geg54dzpvvU6ex5Jt2thcaPx6H3PJt5hvJpDD39HHS2cmpkmU jCcp0C9HEMDJuS0ITed6hAxwPvFHoqgqS6VquyDsEPuJtsfO4GBEY5HAAa7hmJy2 qrQI6LUXqqyhZvZOERDt =aeMK -----END PGP SIGNATURE----- --0Df5iGewtLlnCAvOx2xO1tjpSFt5X1tVN--