[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#39902: 28.0.50; Marking in dired with active region

From: Juri Linkov
Subject: bug#39902: 28.0.50; Marking in dired with active region
Date: Fri, 06 Mar 2020 01:42:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> The peculiarity of dired mode is that it puts point in front of file
>> name.  So when the region doesn't cover the file name visually, it
>> should not take the file name outside the region into consideration
>> for marking.
> But this does not describe what we currently have: you can mark N
> complete lines, from the beginning to the end of the lines.  The file in
> line N is always not marked.

Currently region-based marking works consistently with
argument-based marking, i.e. marking N files using an argument
marks the same number of files as marked by region, for example:

1. when you want to mark next 2 files, you can type:

   C-u 2 m

2. doing the same using the region, you can type the same argument number:

   C-u 2 n

Using the same number (2 in this case) marks the same number of files.

>> Exactly like kill-region should not kill text outside of the active
>> region, dired-mark should not mark files outside of the active region.
>> Especially more dangerous command dired-flag-file-deletion
>> should not delete files outside of the active region.
> This is a bit philosophical.  You can find an argument like this for any
> behavior.  Personally, in my mind I identify the whole line as
> associated to a certain file.  Whatever choice we take we should
> document how an an active region is interpreted since different kinds of
> behavior might be natural for different users.

What do you think about marking the file on the current line
only when point is at the end of the line,
so the file name is completely inside the region?

>> > (2) Most of the time I rather want `dired-mark-files-regexp' to respect
>> > an active region - but that isn't implemented (though it would not be
>> > hard to do).  I think that would be useful.
>> The problem is that this feature should be implemented in the macro
>> dired-mark-if, but then it will affect many other commands:
>> dired-mark-files-containing-regexp
>> dired-mark-symlinks
>> dired-mark-directories
>> dired-mark-executables
>> dired-flag-auto-save-files
>> dired-flag-backup-files
>> dired-compare-directories
>> dired-mark-unmarked-files
>> dired-mark-sexp
>> ...
> Yes.  I think I would vote pro such a change.  It could also be made
> optional by introducing a new user option.

Perhaps no option needed because it's easy just to deactivate the region.
But what is important is to notify in the result message that the operation
was performed on the active region.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]