From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Dziulko Newsgroups: gmane.emacs.help Subject: Re: Trying to merge two files with emacs... need help! Date: Wed, 12 May 2004 05:21:15 -0700 (PDT) Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <20040512122115.19419.qmail@web41807.mail.yahoo.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2093074953==" X-Trace: sea.gmane.org 1084369218 6295 80.91.224.253 (12 May 2004 13:40:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 12 May 2004 13:40:18 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 12 15:39:56 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNtxj-0001nb-00 for ; Wed, 12 May 2004 15:39:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNtu6-00046N-7g for geh-help-gnu-emacs@m.gmane.org; Wed, 12 May 2004 09:36:10 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BNttT-00044X-LH for help-gnu-emacs@gnu.org; Wed, 12 May 2004 09:35:31 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BNtc3-0001SQ-Ul for help-gnu-emacs@gnu.org; Wed, 12 May 2004 09:18:08 -0400 Original-Received: from [66.218.93.141] (helo=web41807.mail.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1BNsje-0001Wj-2t for help-gnu-emacs@gnu.org; Wed, 12 May 2004 08:21:18 -0400 Original-Received: from [192.68.108.35] by web41807.mail.yahoo.com via HTTP; Wed, 12 May 2004 05:21:15 PDT Original-To: help-gnu-emacs@gnu.org In-Reply-To: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Mime-version: 1.0 Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:18438 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18438 --===============2093074953== Content-Type: multipart/alternative; boundary="0-595046009-1084364475=:18631" --0-595046009-1084364475=:18631 Content-Type: text/plain; charset=us-ascii Gary Z wrote: I'm new to emacs and I'm trying to use it to merge two files into one. Some time ago, I watched a co-worker step through a file and selectively merge changes into it from another file. Unfortunately, I don't recall how he did it! Currently, I'm opening a file with emacs, selecting diff (2 files) from the menu, specifying the current file and the file I want to merge into the current file. I hit the space bar and the first difference is displayed. I am able to accept what is in buffer a or buffer b, but I can't figure out how to combine both of them. The buffers look something like this: Buffer A here is the first line. here is the second line. Buffer B here is the third line. here is the fourth line. The result that I want is: here is the first line. here is the second line. here is the third line. here is the fourth line. Any ideas on how I can do this? I guess it's tricky because emacs views it as a conflict, but I want to combine everything, not choose one or the other. Thanks, Gary _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnu-emacs If what you are doing isn't different from your example, you can use insert file. Just open new buffer C, hit cntrl-x, then i, type fileA. The do the same to insert fileB right after A. If you're trying to inter-mix lines from A and lines from B, that's a different stotry ... --------------------------------- Do you Yahoo!? Yahoo! Movies - Buy advance tickets for 'Shrek 2' --0-595046009-1084364475=:18631 Content-Type: text/html; charset=us-ascii
Gary Z <gzimak@yahoo.com> wrote:

I'm new to emacs and I'm trying to use it to merge two files into one.
Some time ago, I watched a co-worker step through a file and
selectively merge changes into it from another file. Unfortunately, I
don't recall how he did it! Currently, I'm opening a file with emacs,
selecting diff (2 files) from the menu, specifying the current file
and the file I want to merge into the current file. I hit the space
bar and the first difference is displayed. I am able to accept what is
in buffer a or buffer b, but I can't figure out how to combine both of
them. The buffers look something like this:

Buffer A
here is the first line.
here is the second line.

Buffer B
here is the third line.
here is the fourth line.

The result that I want is:

here is the first line.
here is the second line.
here is the third line.
here is the fo urth line.

Any ideas on how I can do this? I guess it's tricky because emacs
views it as a conflict, but I want to combine everything, not choose
one or the other.

Thanks,
Gary
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

If what you are doing isn't different from your example, you can use insert file.  Just open new buffer C, hit cntrl-x, then i, type fileA.  The do the same to insert fileB right after A.  If you're trying to inter-mix lines from A and lines from B, that's a different stotry ...


Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2' --0-595046009-1084364475=:18631-- --===============2093074953== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnu-emacs --===============2093074953==--