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

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 25 Jun 2019 16:42:27 +0200

Drew Adams <[email-masked]> writes:

> `dired-mark-if' marks, unmarks, or flags Dired lines that satisfy its
> PREDICATE argument.
>
> But it should do nothing if a given line is already so marked, unmarked,
> or flagged.  More importantly, it should not count that line as having
> been marked, unmarked, or flagged.  The message that echoes the count of
> changes should not take such non-changes into account.

That sounds like a sensible change, and a cursory look at the code seems
to say that nothing uses the return value, anyway.  (So it shouldn't
break anything.)  (But my look was very cursory; this should be
confirmed by looking at the code closer.)

> Here is a fixed version of the macro.  The diff is trivial.

No diff was included, which, as usual, is a shame, because the macro has
changed slightly in the meantime.

>                           (cond ((eq dired-marker-char ?\040)            "Unmarking")

?\040 isn't the recommended way of saying "space".

>                                 ((eq dired-del-marker dired-marker-char) "Flagging")
>                                 (t                                       "Marking"))

Your lines are also too wide; they should be less than 80 characters
wide.

Could you re-spin your change and submit a patch?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no