Subject: Re: bug#20892: 25.0.50; Applying vc-diff hunks on CRLF tracked files

From: Eli Zaretskii <[email-masked]>
Date: Thu, 25 Jun 2015 17:41:13 +0300

> From: João Távora <[email-masked]>
> Date: Thu, 25 Jun 2015 14:54:26 +0100
> Cc: [email-masked]
> 
> I don't think simply removing the CR characters is the right thing, we
> should interpret them according to coding-system-eol-type, right?

You should remove them if coding-system-eol-type for
buffer-file-coding-system of the buffer which the hunk comes from
returns 1.

> So, say a diff hunk contains just a couple of lines with CRLF and a
> couple of lines just LF. If applied to a buffer that is all CRLF, I
> would say that applying this hunk should eventually provoke the normal
> Emacs behaviour of highlighting all CR's except for the two lines with
> LF. Is it worth it? What do you both think?

It depends on what the user wants/needs.  The Patch utility has
options which will cause it to strip the CR characters when applying
the diffs; I guess we should have a similar flexibility here.