* Trying to merge two files with emacs... need help!
@ 2004-05-12 3:25 Gary Z
2004-05-12 6:00 ` Eli Zaretskii
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Gary Z @ 2004-05-12 3:25 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Trying to merge two files with emacs... need help!
2004-05-12 3:25 Trying to merge two files with emacs... need help! Gary Z
@ 2004-05-12 6:00 ` Eli Zaretskii
[not found] ` <mailman.4725.1084338189.1061.help-gnu-emacs@gnu.org>
2004-05-12 12:21 ` Kevin Dziulko
2 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2004-05-12 6:00 UTC (permalink / raw)
> From: gzimak@yahoo.com (Gary Z)
> Newsgroups: gnu.emacs.help
> Date: 11 May 2004 20:25:04 -0700
>
> 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 hope that was a typo, and you actually meant to say that you select
"Merge" from the menu bar, not "Diff".
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <mailman.4725.1084338189.1061.help-gnu-emacs@gnu.org>]
* Re: Trying to merge two files with emacs... need help!
[not found] ` <mailman.4725.1084338189.1061.help-gnu-emacs@gnu.org>
@ 2004-05-12 11:50 ` Gary Z
2004-05-12 20:42 ` Eli Zaretskii
2004-05-12 20:44 ` LEE Sau Dan
0 siblings, 2 replies; 6+ messages in thread
From: Gary Z @ 2004-05-12 11:50 UTC (permalink / raw)
Eli Zaretskii <eliz@gnu.org> wrote in message news:<mailman.4725.1084338189.1061.help-gnu-emacs@gnu.org>...
> > From: gzimak@yahoo.com (Gary Z)
> > Newsgroups: gnu.emacs.help
> > Date: 11 May 2004 20:25:04 -0700
> >
> > 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 hope that was a typo, and you actually meant to say that you select
> "Merge" from the menu bar, not "Diff".
It actually was a typo, but not the one you suggested. I'm chosing
"Compare Two files" from the menu. I was trying not to use Merge,
since I wanted more control over how conflicts are handled. Am I going
about it the wrong way?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Trying to merge two files with emacs... need help!
2004-05-12 11:50 ` Gary Z
@ 2004-05-12 20:42 ` Eli Zaretskii
2004-05-12 20:44 ` LEE Sau Dan
1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2004-05-12 20:42 UTC (permalink / raw)
> From: gzimak@yahoo.com (Gary Z)
> Newsgroups: gnu.emacs.help
> Date: 12 May 2004 04:50:45 -0700
>
> It actually was a typo, but not the one you suggested. I'm chosing
> "Compare Two files" from the menu. I was trying not to use Merge,
> since I wanted more control over how conflicts are handled. Am I going
> about it the wrong way?
I think you need to select "Merge" and then "Files". You will have
full control on how conflicts are handled.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Trying to merge two files with emacs... need help!
2004-05-12 11:50 ` Gary Z
2004-05-12 20:42 ` Eli Zaretskii
@ 2004-05-12 20:44 ` LEE Sau Dan
1 sibling, 0 replies; 6+ messages in thread
From: LEE Sau Dan @ 2004-05-12 20:44 UTC (permalink / raw)
>>>>> "Gary" == Gary Z <gzimak@yahoo.com> writes:
Gary> It actually was a typo, but not the one you suggested. I'm
Gary> chosing "Compare Two files" from the menu. I was trying not
Gary> to use Merge, since I wanted more control over how conflicts
Gary> are handled. Am I going about it the wrong way?
So, type M-x ediff-merge-files RET
Follow the prompts. In the command window (very small), type '?' for
an elaborate help screen. A little bit experimenting with the
commands listed in the help screen should be enough to discover how to
do things.
--
Lee Sau Dan 李守敦 ~{@nJX6X~}
E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Trying to merge two files with emacs... need help!
2004-05-12 3:25 Trying to merge two files with emacs... need help! Gary Z
2004-05-12 6:00 ` Eli Zaretskii
[not found] ` <mailman.4725.1084338189.1061.help-gnu-emacs@gnu.org>
@ 2004-05-12 12:21 ` Kevin Dziulko
2 siblings, 0 replies; 6+ messages in thread
From: Kevin Dziulko @ 2004-05-12 12:21 UTC (permalink / raw)
[-- Attachment #1.1: Type: text/plain, Size: 1576 bytes --]
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 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'
[-- Attachment #1.2: Type: text/html, Size: 1995 bytes --]
[-- Attachment #2: Type: text/plain, Size: 151 bytes --]
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-05-12 20:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-12 3:25 Trying to merge two files with emacs... need help! Gary Z
2004-05-12 6:00 ` Eli Zaretskii
[not found] ` <mailman.4725.1084338189.1061.help-gnu-emacs@gnu.org>
2004-05-12 11:50 ` Gary Z
2004-05-12 20:42 ` Eli Zaretskii
2004-05-12 20:44 ` LEE Sau Dan
2004-05-12 12:21 ` Kevin Dziulko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).