[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60887: 29.0.60; Same keys for vc-dir-mark-by-regexp and dired-mark-f
From: |
Juri Linkov |
Subject: |
bug#60887: 29.0.60; Same keys for vc-dir-mark-by-regexp and dired-mark-files-regexp |
Date: |
Tue, 17 Jan 2023 19:15:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) |
etc/NEWS:
+++
*** New command '%' ('vc-dir-mark-by-regexp').
This command marks files based on a regexp. If given a prefix
argument, unmark instead.
This will cause problems when in the next versions users will request
more Dired keys in Vc-Dir. For marking a regexp, Dired uses two keymaps:
% m dired-mark-files-regexp
* % dired-mark-files-regexp
This patch uses the same keys for compatibility between Dired and Vc-Dir:
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 8c77ded55d3..6cb4309c21b 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1331,11 +1331,17 @@ VC Directory Commands
listed files and directories.
@findex vc-dir-mark-by-regexp
-@item %
+@item % m
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
+state, 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 ac338da71e8..435a84e7f81 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2077,7 +2077,7 @@ The VC Directory buffer now uses the prefix 'b' for these
branch-related
commands.
+++
-*** New command '%' ('vc-dir-mark-by-regexp').
+*** New command '% m' ('vc-dir-mark-by-regexp').
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..749539b9518 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -325,7 +325,6 @@ vc-dir-mode-map
(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 @@ vc-dir-mode-map
(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.
- bug#60887: 29.0.60; Same keys for vc-dir-mark-by-regexp and dired-mark-files-regexp,
Juri Linkov <=