Subject: bug#73407: [PATCH v4] bug#73407: 31.0.50; Add diff-discard-hunk

From: Sean Whitton <[email-masked]>
Date: Wed, 25 Sep 2024 07:36:42 +0100

Hello,

On Tue 24 Sep 2024 at 09:07pm +03, Eli Zaretskii wrote:

>> From: Juri Linkov <[email-masked]>
>> Cc: Eli Zaretskii <[email-masked]>,  [email-masked],  [email-masked]
>> Date: Tue, 24 Sep 2024 19:59:04 +0300
>>
>> >>> -           (message "%d hunks failed; no buffers changed" failures)))))
>> >>> +           (message "%d hunks failed; no buffers changed" failures)
>> >>> +           failures))))
>> >>
>> >> This comes from existing text, but still: what does the above say when
>> >> there's only 1 failure? does it say "1 hunks failed"?  If so, can we
>> >> improve the handling of singular/plural here?
>> >
>> > I've installed a fix for that.
>>
>> Another variant would be to use 'ngettext'.
>
> That's what I had in mind...

Do you mean like this?

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index be3d94db011..9677fbb9175 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2083,7 +2083,7 @@ diff-apply-buffer
            (message "Saved %d buffers" (length buffer-edits)))
           (t
            (message "%d %s failed; no buffers changed"
-                    failures (if (> failures 1) "hunks" "hunk"))))))
+                    failures (ngettext "hunk" "hunks" failures))))))

 (defalias 'diff-mouse-goto-source #'diff-goto-source)

-- 
Sean Whitton