Subject: bug#76769: 31.0.50; marking inconsistency between VC-Dir and dired-vc-next-action

From: Sean Whitton <[email-masked]>
Date: Fri, 14 Mar 2025 11:41:34 +0800

Hello,

On Wed 12 Mar 2025 at 04:29pm +02, Eli Zaretskii wrote:

>> - When you try to mark a file but you can't because the directory is
>>   already marked, unmark the directory first.
>
> I'm asking: what if I want to unmark a file whose directory is already
> unmarked?
> [...]
>
>> - When you try to mark a directory but you can't because a file under it
>>   is already marked, unmark all files under it and mark the directory,
>>   instead.
>
> I'm asking: what if I want to unmark a directory which has a file
> under it already unmarked?

Ah, these are good questions.  Here is a revised proposal:

A defcustom with values nil, 'ask, t.  nil is the current behaviour.
'ask means to do the follow things after a y/n prompt, t means to do
them unconditionally:

- When you try to mark a file but you can't because the directory is
  already marked, unmark the directory first.

- When you use unmark on a file that is not explicitly marked but its
  directory is marked, unmark the directory and mark all files under it
  except the current one.

- When you try to mark a directory but you can't because a file under it
  is already marked, unmark all files under it and mark the directory,
  instead.

- When you use unmark on a directory that is not marked but has some
  files under it marked, unmark all of those.

Plus fixing dired-vc-next-action.

-- 
Sean Whitton