From 78f93d92b2871cc05f5293c7344fe5fe188a763c Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 18 Jan 2023 19:55:10 +0200 Subject: [PATCH] =?utf8?q?*=20lisp/vc/vc-dir.el:=20Make=20keys=20=E2=80=98?= =?utf8?q?%=20m=E2=80=99=20and=20=E2=80=98*=20%=E2=80=99=20compatible=20wi?= =?utf8?q?th=20Dired?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit (vc-dir-mode-map): Replace ‘%’ for vc-dir-mark-by-regexp with ‘% m’ in regexp-map and ‘* %’ in mark-map (bug#60887). * doc/emacs/maintaining.texi (VC Directory Commands): Replace ‘%’ with ‘% m’ and ‘* %’. Mention vc-dir-mark-registered-files. --- doc/emacs/maintaining.texi | 9 ++++++++- etc/NEWS | 2 +- lisp/vc/vc-dir.el | 8 ++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 8c77ded55d3..5191bb2918d 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1331,11 +1331,18 @@ point is on a directory entry, mark all files in that directory tree listed files and directories. @findex vc-dir-mark-by-regexp -@item % +@item % m +@itemx * % You can use this command to mark files by regexp (@code{vc-dir-mark-by-regexp}). If given a prefix, unmark files instead. +@findex vc-dir-mark-registered-files +@item * r +You can use this command to mark files that are in one of registered +states, including edited, added or removed. +(@code{vc-dir-mark-registered-files}). + @item G Add the file under point to the list of files that the VC should ignore (@code{vc-dir-ignore}). For instance, if the VC is Git, it diff --git a/etc/NEWS b/etc/NEWS index 95dd4a24ec3..14941b906ef 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2079,7 +2079,7 @@ The VC Directory buffer now uses the prefix 'b' for these branch-related commands. +++ -*** New command '%' ('vc-dir-mark-by-regexp'). +*** New command 'vc-dir-mark-by-regexp' bound to '% m' and '* %'. This command marks files based on a regexp. If given a prefix argument, unmark instead. diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 312556f644a..53d58870b32 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -325,7 +325,6 @@ See `run-hooks'." (define-key map "U" #'vc-dir-unmark-all-files) (define-key map "\C-?" #'vc-dir-unmark-file-up) (define-key map "\M-\C-?" #'vc-dir-unmark-all-files) - (define-key map "%" #'vc-dir-mark-by-regexp) ;; Movement. (define-key map "n" #'vc-dir-next-line) (define-key map " " #'vc-dir-next-line) @@ -361,8 +360,13 @@ See `run-hooks'." (define-key branch-map "l" #'vc-print-branch-log) (define-key branch-map "s" #'vc-switch-branch)) + (let ((regexp-map (make-sparse-keymap))) + (define-key map "%" regexp-map) + (define-key regexp-map "m" #'vc-dir-mark-by-regexp)) + (let ((mark-map (make-sparse-keymap))) (define-key map "*" mark-map) + (define-key mark-map "%" #'vc-dir-mark-by-regexp) (define-key mark-map "r" #'vc-dir-mark-registered-files)) ;; Hook up the menu. @@ -791,7 +795,7 @@ MARK-FILES should be a list of absolute filenames." vc-ewoc)) (defun vc-dir-mark-registered-files () - "Mark files that are in one of registered state: edited, added or removed." + "Mark files that are in one of registered states: edited, added or removed." (interactive) (vc-dir-mark-state-files '(edited added removed))) -- 2.39.2