Variable: dired-mark-region
dired-mark-region is a customizable variable defined in dired.el.gz.
Value
file
Documentation
Defines what commands that mark files do with the active region.
When nil, marking commands don't operate on all files in the active region. They process their prefix arguments as usual.
When the value of this option is non-nil, then all Dired commands that mark or unmark files will operate on all files in the region if the region is active in Transient Mark mode.
When file, the region marking is based on the file name.
This means don't mark the file if the end of the region is
before the file name displayed on the Dired line, so the file name
is visually outside the region. This behavior is consistent with
marking files without the region using the key \m that advances
point to the next line after marking the file. Thus the number
of keys used to mark files is the same as the number of keys
used to select the region, for example \M-2 m marks 2 files, and
\C-SPC M-2 n m marks 2 files, and \M-2 S-<down> m marks 2 files.
When line, the region marking is based on Dired lines,
so include the file into marking if the end of the region
is anywhere on its Dired line, except the beginning of the line.
This variable was added, or its default value changed, in Emacs 28.1.
Probably introduced at or before Emacs version 28.1.
Source Code
;; Defined in /usr/src/emacs/lisp/dired.el.gz
(defcustom dired-mark-region 'file
"Defines what commands that mark files do with the active region.
When nil, marking commands don't operate on all files in the
active region. They process their prefix arguments as usual.
When the value of this option is non-nil, then all Dired commands
that mark or unmark files will operate on all files in the region
if the region is active in Transient Mark mode.
When `file', the region marking is based on the file name.
This means don't mark the file if the end of the region is
before the file name displayed on the Dired line, so the file name
is visually outside the region. This behavior is consistent with
marking files without the region using the key \\`m' that advances
point to the next line after marking the file. Thus the number
of keys used to mark files is the same as the number of keys
used to select the region, for example \\`M-2 m' marks 2 files, and
\\`C-SPC M-2 n m' marks 2 files, and \\`M-2 S-<down> m' marks 2 files.
When `line', the region marking is based on Dired lines,
so include the file into marking if the end of the region
is anywhere on its Dired line, except the beginning of the line."
:type '(choice
(const :tag "Don't mark files in active region" nil)
(const :tag "Exclude file name outside of region" file)
(const :tag "Include the file at region end line" line))
:group 'dired
:version "28.1")