How to copy several lines from a buffer to another in Emacs?

emacs

Solution

A simple solution would be recording a macro that copies a line from one buffer to another ( f3 C-SCP C-n M-w C-x o C-y C-x o f4) and then execute the macro (f4)on every line you want to copy.

If this is a recurring scenario for you, you can save the macro and bind it to a key.

Problem

I have two buffers. I want to copy the line 2, 5, 9 and 10 in the first buffer to the second buffer(just append to the second buffer). Except copy and past one line at a time, is there any elegant way to do so?

Original source