From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.help Subject: Re: How to edit/modify patches using emacs? Date: Sun, 08 May 2005 23:45:34 +0900 Message-ID: <87ekchn5dd.fsf@tc-1-100.kawasaki.gol.ne.jp> References: <427df645$0$26177$9b622d9e@news.freenet.de> <87u0ldx29s.fsf@thalassa.informatimago.com> Reply-To: Miles Bader NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1115565023 545 80.91.229.2 (8 May 2005 15:10:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 8 May 2005 15:10:23 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 08 17:10:18 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DUnPh-0002qw-4J for geh-help-gnu-emacs@m.gmane.org; Sun, 08 May 2005 17:09:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DUnVJ-0008Bq-Ai for geh-help-gnu-emacs@m.gmane.org; Sun, 08 May 2005 11:15:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DUnTt-0007jI-71 for help-gnu-emacs@gnu.org; Sun, 08 May 2005 11:14:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DUnG9-0004XF-Vh for help-gnu-emacs@gnu.org; Sun, 08 May 2005 11:00:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DUnG6-0004Ne-Tr for help-gnu-emacs@gnu.org; Sun, 08 May 2005 10:59:54 -0400 Original-Received: from [203.216.5.72] (helo=smtp02.dentaku.gol.com) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DUn84-0000WD-DB; Sun, 08 May 2005 10:51:36 -0400 Original-Received: from localhost ([127.0.0.1]) by smtp02.dentaku.gol.com with esmtp (Dentaku) id 1DUn2I-0002WE-0a; Sun, 08 May 2005 23:45:38 +0900 Original-Received: from yokohama2-61-203-152-134.ap.0038.net ([61.203.152.134] helo=tc-1-100.kawasaki.gol.ne.jp) by smtp02.dentaku.gol.com with esmtpa (Dentaku) id 1DUn2H-0002W2-8n; Sun, 08 May 2005 23:45:37 +0900 Original-Received: by tc-1-100.kawasaki.gol.ne.jp (Postfix, from userid 1000) id 5D6D5FB9; Sun, 8 May 2005 23:45:34 +0900 (JST) Original-To: help-gnu-emacs@gnu.org System-Type: i686-pc-linux-gnu In-Reply-To: <87u0ldx29s.fsf@thalassa.informatimago.com> (Pascal Bourguignon's message of "Sun, 08 May 2005 15:42:23 +0200") Original-Lines: 21 X-Virus-Scanned: by AMaViS GOL X-Abuse-Complaints: abuse@gol.com X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26427 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26427 Pascal Bourguignon writes: > You can force edit it (see the other answers), but I think the best > way to "edit" a patch, is to duplicate the source directory, apply the > patch on one copy, edit this copy of the source files, then invoke > diff to create a new patch. Note that editing a patch with emacs `diff-mode' active is actually fairly painless, because diff-mode takes care of keeping details like the line counts updated, offers convenient functions like hunk- splitting, makes it super easy to test your changes, etc. I regularly edit patches directly because of diff-mode. [A common reason to edit a patch is because it _won't_ apply otherwise: you basically look at the patch to see why doesn't match the source, edit the patch to test your guess, and if it then applies cleanly, you've got a nice record in the edited patch.] -Miles -- "Suppose we've chosen the wrong god. Every time we go to church we're just making him madder and madder." -- Homer Simpson