bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18236: diff-apply-hunk interacts poorly with line endings


From: Eli Zaretskii
Subject: 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 <address@hidden>
> Cc: Marcin Borkowski <address@hidden>, address@hidden
> 
>  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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]