From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Where is patch? - problems with patch.exe on w32 Date: Thu, 15 Dec 2005 06:26:07 +0200 Message-ID: References: <43A064AD.4050604@student.lu.se> <20051214192858.GM2399@calimero.vinschen.de> <43A07425.70205@student.lu.se> <43A07AC3.1030209@student.lu.se> Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1134620789 14218 80.91.229.2 (15 Dec 2005 04:26:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Dec 2005 04:26:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 15 05:26:26 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EmkhB-00074D-Hu for ged-emacs-devel@m.gmane.org; Thu, 15 Dec 2005 05:26:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Emkho-0002pc-8z for ged-emacs-devel@m.gmane.org; Wed, 14 Dec 2005 23:27:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Emkhf-0002pW-50 for emacs-devel@gnu.org; Wed, 14 Dec 2005 23:26:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Emkhd-0002pH-8t for emacs-devel@gnu.org; Wed, 14 Dec 2005 23:26:50 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Emkhd-0002pE-6W for emacs-devel@gnu.org; Wed, 14 Dec 2005 23:26:49 -0500 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Emkjo-0003jN-I6 for emacs-devel@gnu.org; Wed, 14 Dec 2005 23:29:04 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-86-229.inter.net.il [80.230.86.229]) by romy.inter.net.il (MOS 3.7.2-GA) with ESMTP id DEK69128 (AUTH halo1); Thu, 15 Dec 2005 06:26:07 +0200 (IST) Original-To: Lennart Borgman In-reply-to: <43A07AC3.1030209@student.lu.se> (message from Lennart Borgman on Wed, 14 Dec 2005 21:04:19 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:47771 Archived-At: > Date: Wed, 14 Dec 2005 21:04:19 +0100 > From: Lennart Borgman > > 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.