GNU bug report logs - #18236
diff-apply-hunk interacts poorly with line endings

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Sun, 10 Aug 2014 15:35:02 UTC

Severity: normal

Tags: confirmed

Full log


Message #26 received at 18236 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: mbork <at> mbork.pl, 18236 <at> debbugs.gnu.org
Subject: Re: bug#18236: diff-apply-hunk interacts poorly with line endings
Date: Sat, 20 Feb 2016 14:50:47 +0200
> Date: Sat, 20 Feb 2016 12:32:03 +0000
> From: Reuben Thomas <rrt <at> sc3d.org>
> Cc: Marcin Borkowski <mbork <at> mbork.pl>, 18236 <at> debbugs.gnu.org
> 
>  The most we can do is display a warning and ask for confirmation when
>  the values of buffer-file-coding-system differ between the patch
>  file's buffer and the buffer of file to be patched. Will that be
>  sufficient?
> 
> Thanks for your analysis. ​This solution sounds fine to me: ​as you say, in general it's impossible to tell exactly
> what went wrong, but we can warn the user so that the unfortunate result I described is not obtained silently.

Marcin, would you like to work on a change along these lines?

The function to use for comparing 2 coding-systems is
`coding-system-equal'.  The idea is to see if the values of
`buffer-file-coding-system' in the patch-file buffer (where the
command is invoked) and in the buffer that visits the file to be
patched (after `find-file-noselect' call in
`diff-find-source-location' returns) are different, and if so, ask the
user for confirmation.  Ideally, the confirmation should only be
requested once, when applying the 1st hunk from the patch file.

Thanks.




This bug report was last modified 9 years and 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.