Subject: bug#65380: [PATCH] Add command to copy contents in a diff-mode buffer

From: Philip Kaludercic <[email-masked]>
Date: Tue, 20 Aug 2024 16:23:09 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: Philip Kaludercic <[email-masked]>
>> Cc: [email-masked],  [email-masked]
>> Date: Tue, 20 Aug 2024 12:10:01 +0000
>> 
>> Eli Zaretskii <[email-masked]> writes:
>> 
>> >>                            If the selected range extends a hunk, the
>> >> +commands attempts to look up and copy the text between from the
>> >> +referenced file.                          ^^^^^^^^^^^^^^^^^
>> >
>> > Something is missing (or redundant) in this sentence.
>> 
>> How about "the text in between from".  Does that sound better?
>>                     ^^
>
> If that's what you mean, I suggest "the text in-between the hunks".

Stole that idea :)

>> >> +By default the command will copy the text that applying the diff would
>> >> +produce, along with the text between hunks.  If REVERSE is non-nil, or
>> >> +the command was invoked with a prefix argument, copy the deleted text."
>> >
>> > The "deleted text" part here is unclear: who or what deletes text and
>> > what text is deleted?
>> 
>> I want to express that it copies the parts of the diff, that the
>> changeset removes (lines beginning with "-").  So perhaps "... copy the text
>> removed in the diff" would be better?
>
> I think "copy the text removed by the diffs", and perhaps say
> explicitly that those are the lines in the hunks preceded with "-".

According to `diff-font-lock-keywords' diff-mode also supports the "<"
syntax for removed parts of a hunk (I believe this comes from RCS?).
Then again, I would assume that the structure and contents of a diff
should be familiar to anyone using diff-mode seriously enough to be
interested in a command like this one?

-- 
	Philip Kaludercic on peregrine