Function: vc-dir-mark-by-regexp
vc-dir-mark-by-regexp is an interactive and byte-compiled function
defined in vc-dir.el.gz.
Signature
(vc-dir-mark-by-regexp REGEXP &optional UNMARK)
Documentation
Mark all files that match REGEXP.
If UNMARK (interactively, the prefix), unmark instead.
Probably introduced at or before Emacs version 29.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc-dir.el.gz
(defun vc-dir-mark-by-regexp (regexp &optional unmark)
"Mark all files that match REGEXP.
If UNMARK (interactively, the prefix), unmark instead."
(interactive "sMark files matching: \nP")
(ewoc-map
(lambda (filearg)
(when (and (not (vc-dir-fileinfo->directory filearg))
(eq (not unmark)
(not (vc-dir-fileinfo->marked filearg)))
;; We don't want to match on the part of the file
;; that's above the current directory.
(string-match-p regexp (file-relative-name
(vc-dir-fileinfo->name filearg))))
(setf (vc-dir-fileinfo->marked filearg) (not unmark))
t))
vc-ewoc))