From: Juri Linkov Date: Wed, 18 Jan 2023 17:55:10 +0000 (+0200) Subject: * lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible with Dired X-Git-Tag: emacs-29.0.90~677 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=78f93d92b2871cc05f5293c7344fe5fe188a763c;p=emacs.git * lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible with Dired (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. --- 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)))