GNU bug report logs -
#20892
25.0.50; Applying vc-diff hunks on CRLF tracked files
Previous Next
Reported by: joaotavora <at> gmail.com (João Távora)
Date: Wed, 24 Jun 2015 11:30:05 UTC
Severity: normal
Found in version 25.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 20892 <at> debbugs.gnu.org (full text, mbox):
On Wed, Jun 24, 2015 at 3:57 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: joaotavora <at> gmail.com (João Távora)
> > Date: Wed, 24 Jun 2015 12:29:05 +0100
> >
> > @@ -1799,7 +1799,8 @@
> > (with-current-buffer buf
> > (goto-char (car pos))
> > (delete-region (car pos) (cdr pos))
> > - (insert (car new)))
> > + (insert (decode-coding-string (car new)
> > + buffer-file-coding-system)))
>
> That doesn't sound right: the string you are passing to
> decode-coding-string is already a multibyte string in Emacs's internal
> representation. So decoding it one more time is not what you want.
>
> I think we should simply remove the CR characters from the end of each
> line, if buffer-file-coding-system states DOS EOL format. (You can
> check the latter with coding-system-eol-type.)
I see my mistake now, thanks. (also thanks Stefan). It worked so I
assumed magically it's the right thing without thinking too hard. But
I don't think simply removing the CR characters is the right thing, we
should interpret them according to coding-system-eol-type, right?
It's more complicated, but I can give it a try (maybe meanwhile commit
a patch that does what you say to fix the current unusable state of
diff-apply-hunk in this situation)
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?
João
This bug report was last modified 9 years and 52 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.