emacs-devel
[Top][All Lists]
Advanced

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

Re: Where is patch? - problems with patch.exe on w32


From: Eli Zaretskii
Subject: Re: Where is patch? - problems with patch.exe on w32
Date: Thu, 15 Dec 2005 06:26:07 +0200

> Date: Wed, 14 Dec 2005 21:04:19 +0100
> From: Lennart Borgman <address@hidden>
> 
> The trouble I had turned out to be one with line endings. For some 
> reason patch does not behave as Emacs on w32 when it comes to line 
> endings. A line and should just be a line end in my opinion. The patched 
> text file should retain its original line format. If this is possible 
> then that would really give me and other using w32 a fair chance of 
> doing useful work. So I hope to get in contact with the patch maintainer 
> about this.

I use the GnuWin32 port of Patch on Windows, and it works fine for me.
Since I checkout Emacs files with -kb option to "cvs up", they (the
text files in Emacs source tree) have Unix-style EOLs.  Therefore, I
always invoke Patch with the --binary command-line option, which
causes Patch to preserve the Unix EOL format in the patched files.
Since Patch already knows how to detect DOS-style CR-LF EOLs in the
patch files and strip the CRs, this invocation method takes care of
all the problems with EOLs I ever had.

If I need to invoke Patch from within Emacs (e.g., if the patch was
sent in an email message), I do that with "C-x RET c Unix RET M-|",
which causes Emacs to pass the patch file to Patch with Unix EOLs.

These are all the tricks I need to get Patch DTRT on Windows.  It
works perfectly.




reply via email to

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