Subject: bug#22457: 24.5; [PATCH] `dired-mark-if' should not count non-changes

From: Drew Adams <[email-masked]>
Date: Tue, 25 Jun 2019 16:17:02 -0700 (PDT)

> > *** The marking commands now report how many files were marked by the
> > command itself, not how many files are marked in total.
> > --
> 
> I don't think this exactly describes what the patch changed: it is not
> about new vs total marks, but about marks of files that were already
> marked before, right?

It's about making the reported count refer to
the number of marks that were changed or added.

The old way counted all of the matches.
The new way counts only matches that are not
already marked the same way.

> > Perhaps somebody will want to weigh in here; feel free to revert the
> > commit if this is felt to be a confusing change.
> 
> IIUC: Maybe we could add to the summary message something like
> "(N already were marked)" or so if a command finds existent marks on files
> to be marked?  That might be useful information, even independent from
> this change, because it might also be a hint for a pilot error.

That's what the "better" version does that I sent
as an _attachment_.

If some were already marked as directed it says:

"42 foobars matched, 35 newly marked"    or
"42 foobars matched, 35 newly unmarked"  or
"42 foobars matched, 35 newly flagged"   or
"42 foobars matched, 35 newly unflagged"

(If all that were matched were already marked
as directed then instead of "35" it says "0".)

Otherwise (no matches were already marked as
directed) it says:

"42 foobars newly marked"    or
"42 foobars newly unmarked"  or
"42 foobars newly flagged"   or
"42 foobars newly unflagged"