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 22:59:06 +0200 Organization: LINKOV.NET Message-ID: <874kuci4tx.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> <87y2rpqt28.fsf@mail.linkov.net> 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="28028"; 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 Wed Mar 25 22:01:43 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 1jHD9i-0007C0-UM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Mar 2020 22:01:43 +0100 Original-Received: from localhost ([::1]:43332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHD9h-0004wJ-Rs for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Mar 2020 17:01:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43003) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHD89-0003NI-HS for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2020 17:00:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHD88-00080F-7R for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2020 17:00:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51879) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHD88-0007zw-2w for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2020 17:00:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jHD87-0008Bq-1U for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2020 17:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Mar 2020 21:00: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.158516998831424 (code B ref 34949); Wed, 25 Mar 2020 21:00:02 +0000 Original-Received: (at 34949) by debbugs.gnu.org; 25 Mar 2020 20:59:48 +0000 Original-Received: from localhost ([127.0.0.1]:57850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHD7s-0008Am-HY for submit@debbugs.gnu.org; Wed, 25 Mar 2020 16:59:48 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:57787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHD7n-00089z-Eo for 34949@debbugs.gnu.org; Wed, 25 Mar 2020 16:59:44 -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 relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 7EE0020003; Wed, 25 Mar 2020 20:59:35 +0000 (UTC) In-Reply-To: <87y2rpqt28.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 25 Mar 2020 00:36:15 +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:177724 Archived-At: --=-=-= Content-Type: text/plain >> 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 > ... This is implemented as well: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=vc-dir-mark-state-files.patch diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 38b4937e85..87b6b3b547 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -147,6 +147,12 @@ vc-dir-menu-map '(menu-item "Unmark Previous " vc-dir-unmark-file-up :help "Move to the previous line and unmark the file")) + (define-key map [mark-unregistered] + '(menu-item "Mark Unregistered" vc-dir-mark-unregistered-files + :help "Mark all files in the unregistered state")) + (define-key map [mark-registered] + '(menu-item "Mark Registered" vc-dir-mark-registered-files + :help "Mark all files in the state edited, added or removed")) (define-key map [mark-all] '(menu-item "Mark All" vc-dir-mark-all-files :help "Mark all files that are in the same state as the current file\ @@ -310,6 +316,11 @@ vc-dir-mode-map (define-key branch-map "l" 'vc-print-branch-log) (define-key branch-map "s" 'vc-retrieve-tag)) + (let ((mark-map (make-sparse-keymap))) + (define-key map "*" mark-map) + (define-key mark-map "r" 'vc-dir-mark-registered-files) + (define-key mark-map "u" 'vc-dir-mark-unregistered-files)) + ;; Hook up the menu. (define-key map [menu-bar vc-dir-mode] `(menu-item @@ -696,6 +707,27 @@ vc-dir-mark-all-files (vc-dir-mark-file crt))) (setq crt (ewoc-next vc-ewoc crt)))))))) +(defun vc-dir-mark-state-files (states) + "Mark files that are in the state specified by the list in STATES." + (unless (listp states) + (setq states (list states))) + (ewoc-map + (lambda (filearg) + (when (memq (vc-dir-fileinfo->state filearg) states) + (setf (vc-dir-fileinfo->marked filearg) t) + t)) + vc-ewoc)) + +(defun vc-dir-mark-registered-files () + "Mark files that are in one of registered state: edited, added or removed." + (interactive) + (vc-dir-mark-state-files '(edited added removed))) + +(defun vc-dir-mark-unregistered-files () + "Mark files that are in unregistered state." + (interactive) + (vc-dir-mark-state-files 'unregistered)) + (defun vc-dir-unmark-file () ;; Unmark the current file and move to the next line. (let* ((crt (ewoc-locate vc-ewoc)) --=-=-=--