From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Eure Newsgroups: gmane.emacs.help Subject: Re: how to patch diff into source code? Date: Wed, 21 Jan 2009 14:55:50 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232578610 27734 80.91.229.12 (21 Jan 2009 22:56:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2009 22:56:50 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xah Lee Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 21 23:58:03 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LPm1D-0002Sk-RI for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Jan 2009 23:57:56 +0100 Original-Received: from localhost ([127.0.0.1]:43585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPlzw-0007f3-OD for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Jan 2009 17:56:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPlzG-0007I5-4s for help-gnu-emacs@gnu.org; Wed, 21 Jan 2009 17:55:54 -0500 Original-Received: from [199.232.76.173] (port=45114 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPlzF-0007Hm-MA for help-gnu-emacs@gnu.org; Wed, 21 Jan 2009 17:55:53 -0500 Original-Received: from mail.digg.com ([64.191.203.36]:53713) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPlzF-0005AQ-8j for help-gnu-emacs@gnu.org; Wed, 21 Jan 2009 17:55:53 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.digg.com (Postfix) with ESMTP id DE699A8504F; Wed, 21 Jan 2009 14:55:51 -0800 (PST) X-Virus-Scanned: amavisd-new at X-Spam-Score: -4.497 Original-Received: from mail.digg.com ([127.0.0.1]) by localhost (mail.digg.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f-AFTN5g6bRP; Wed, 21 Jan 2009 14:55:51 -0800 (PST) Original-Received: from [10.2.16.254] (diggstage01.digg.com [64.191.203.34]) by mail.digg.com (Postfix) with ESMTP id 3BFE8A84FCD; Wed, 21 Jan 2009 14:55:51 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.930.3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:61545 Archived-At: On Jan 20, 2009, at 6:08 PM, Xah Lee wrote: > could anyone help me with a diff/patch question? > > i got the following patch: > > (snip) > > is it something i did wrong or the patch? > Maybe both, it's hard to tell if that's the patch, or if it's getting mangled because of email. Generally, you create patches with diff and apply them with patch. E.g.: $ patch < thepatchfile You need to make note of the paths in the header, and make sure you: 1. Put the patch in the same relative location as it was generated from, i.e. you can do "ls lisp\textmodes\css-mode.el" and you see the correct file. 2. Pass a prune argument to patch; this strips off the leading part of the path in the patch. So if you were in the `lisp' directory, you'd give it -p1, if you were in `textmodes', you'd give it -p2, and so on. Alternately, you can place the patch file in the correct location, open it with Emacs, and use C-c C-a (diff-apply-hunk) to apply the changes within Emacs. - Ian