From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#34949: 27.0.50; Docstring of `vc-deduce-fileset' incomplete Date: Wed, 25 Mar 2020 00:36:15 +0200 Organization: LINKOV.NET Message-ID: <87y2rpqt28.fsf@mail.linkov.net> References: <87sgizy16y.fsf@mail.linkov.net> <1f31a329-eaee-f704-9a58-1b048a6ee636@yandex.ru> <87fteyl64x.fsf@mail.linkov.net> <47fcc86a-a884-0658-d1cb-8666704924e8@yandex.ru> <87o8tkgbe2.fsf@mail.linkov.net> <8736avy640.fsf@mail.linkov.net> <76e52ade-bb44-427a-0910-3fe3cf65bf6d@yandex.ru> <87a751uonw.fsf@mail.linkov.net> <9bab3a53-ec31-3300-132f-dc1e17ee0c53@yandex.ru> <875zfd9lzm.fsf@mail.linkov.net> <87mu8mieve.fsf@mail.linkov.net> <87k13pkxdl.fsf@mail.linkov.net> <207d4e30-aa59-b8eb-c39a-0957757f39eb@yandex.ru> <875zf6cy3w.fsf@mail.linkov.net> <9c39f788-29f1-5a68-c8f3-a4b08ae9ea3b@yandex.ru> <87lfo1dvcf.fsf@mail.linkov.net> <44cda45a-db93-f2c1-626d-9ace68cd6fd1@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="126290"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 34949@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 24 23:48:39 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jGsLe-000Wld-EW for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Mar 2020 23:48:38 +0100 Original-Received: from localhost ([::1]:56272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGsLd-0007LX-Hi for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Mar 2020 18:48:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46652) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGsL6-000786-G5 for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2020 18:48:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGsL4-0004ZM-LI for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2020 18:48:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49753) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jGsL4-0004Z7-Db for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2020 18:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jGsL4-00087p-Cg for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2020 18:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Mar 2020 22:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34949 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 34949-submit@debbugs.gnu.org id=B34949.158509006631202 (code B ref 34949); Tue, 24 Mar 2020 22:48:02 +0000 Original-Received: (at 34949) by debbugs.gnu.org; 24 Mar 2020 22:47:46 +0000 Original-Received: from localhost ([127.0.0.1]:55725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGsKn-00087C-Pl for submit@debbugs.gnu.org; Tue, 24 Mar 2020 18:47:46 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:53661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGsKi-00086j-V1 for 34949@debbugs.gnu.org; Tue, 24 Mar 2020 18:47:41 -0400 X-Originating-IP: 91.129.96.173 Original-Received: from mail.gandi.net (m91-129-96-173.cust.tele2.ee [91.129.96.173]) (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 6BB7D60003; Tue, 24 Mar 2020 22:47:33 +0000 (UTC) In-Reply-To: <44cda45a-db93-f2c1-626d-9ace68cd6fd1@yandex.ru> (Dmitry Gutov's message of "Mon, 16 Mar 2020 22:17:38 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177694 Archived-At: --=-=-= Content-Type: text/plain >>>> Maybe then a shorter name vc-root-dir-action? >>> >>> The word "action" there seems to hold no particular meaning. >>> >>> vc-root-dir-with-dwim-selection, maybe? >> Shorter names: >> vc-dir-root-registered >> or just >> vc-dir-registered > > These either sound like callbacks, or alternatively make an impression that > only registered files will be *shown* (not marked). Then the name could be vc-dir-and-mark-registered, but maybe it's not needed given the below. > Are you sure you don't want to split it into a new command that will simply > mark a set of files you expect here? E.g. all belonging to "registered" > statuses. That might require extra keypress, but vc-dir-root-registered is > probably not going to have the same short combination that vc-dir has > anyway. So it might be a wash, keypresses-wise. VC-Dir needs the same key prefix as is provided by Dired: * % dired-mark-files-regexp * * dired-mark-executables * / dired-mark-directories * ? dired-unmark-all-files * @ dired-mark-symlinks * s dired-mark-subdir-files Then VC-Dir could provide, for example: * r vc-dir-mark-registered * u vc-dir-mark-unregistered ... > And vc-dir-root can just be "vc-dir in the repository root" that we both > have wanted for a while. Finally settled with the following patch. >> Also there is a command 'vc-register' (C-x v i). >> Its counterpart could be named 'vc-dir-register' >> and will open a vc-dir buffer where only unregistered >> files will be marked. > > Are you sure you will remember the new commands and use them on a regular > basis? I most likely won't. > > And similarly, we can add a special command to mark only unregistered > files. Although it's usually not a problem to navigate to the first > unregistered one and press 'M'. Often this is a minor problem, but given the above, a keybinding like `* u' should be of a little help. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=vc-dir-root.patch diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 38b4937e85..8c45ad9b80 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1286,6 +1309,16 @@ vc-dir-deduce-fileset (setq model (vc-checkout-model vc-dir-backend only-files-list)))) (list vc-dir-backend files only-files-list state model))) +;;;###autoload +(defun vc-dir-root () + "Run `vc-dir' in the repository root directory without prompt. +If the default directory of the current buffer is +not under version control, prompt for the directory." + (interactive) + (let ((root-dir (vc-root-dir))) + (if root-dir (vc-dir root-dir) + (call-interactively 'vc-dir)))) + ;;;###autoload (defun vc-dir (dir &optional backend) "Show the VC status for \"interesting\" files in and below DIR. diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 345a28d3f1..1a92cd867c 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -972,9 +972,9 @@ vc-menu-map (bindings--define-key map [vc-ignore] '(menu-item "Ignore File..." vc-ignore :help "Ignore a file under current version control system")) - (bindings--define-key map [vc-dir] - '(menu-item "VC Dir" vc-dir - :help "Show the VC status of files in a directory")) + (bindings--define-key map [vc-dir-root] + '(menu-item "VC Dir" vc-dir-root + :help "Show the VC status of the repository")) map)) (defalias 'vc-menu-map vc-menu-map) --=-=-=--