unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18236: diff-apply-hunk interacts poorly with line endings
@ 2014-08-10 15:34 Reuben Thomas
  2016-02-17 15:35 ` Marcin Borkowski
  0 siblings, 1 reply; 10+ messages in thread
From: Reuben Thomas @ 2014-08-10 15:34 UTC (permalink / raw)
  To: 18236

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

I'm using Emacs 24.3. Consider the following two files:

foo:
----cut here----
This is a small test file.
It has DOS line endings.
----cut here----

bar:
----cut here----
This is a small test file.
It too has DOS line endings.
----cut here----

Save them with DOS line endings, and

diff foo bar > foo.patch
cp foo bar

Visit foo.patch. When I do that, each line ends in ^M.

Now, in the patch buffer, M-x diff-apply-hunk. Note that the ^Ms have been
added to the lines. Writing the buffer and examination with "hd" reveals
that each line now ends \r\r\n.

It seems what's happened here is that diff-mode doesn't try to diagnose the
character encoding of the patch file.

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 1082 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-02-21 15:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-10 15:34 bug#18236: diff-apply-hunk interacts poorly with line endings Reuben Thomas
2016-02-17 15:35 ` Marcin Borkowski
2016-02-17 16:39   ` Eli Zaretskii
2016-02-17 19:59     ` Reuben Thomas
2016-02-17 20:14       ` Eli Zaretskii
2016-02-20 12:16         ` Eli Zaretskii
2016-02-20 12:32           ` Reuben Thomas
2016-02-20 12:50             ` Eli Zaretskii
2016-02-21 10:09               ` Marcin Borkowski
2016-02-21 15:56                 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).