- Subject: Re: [jed-users] yank.sl
- From: jed@xxxxxxxxxxx (John E. Davis)
- Date: Mon, 29 Sep 2014 09:09:44 -0400
Peter D. Gray <pdg@xxxxxxxxxx> wrote:
> What I want is a function which allows me to wander around a file
> cutting text, then copy all the yanked text back at a single point.
Have you considered using a macro? Here is how I would approach this:
1. Split the window such that two windows appear on the display--
one containing the file, and the other with the *scratch* buffer.
2. In the buffer with the file, move to the start of the text that
you want to cut and mark that text.
3. Start the macro definition. This is on the Edit->Key Macros
menu, or `Ctrl-X (' in emacs mode.
4. Cut the text.
5. Change to the other window containing the *scratch* buffer.
6. Paste the text that was cut into the scratch buffer.
7. Move back to the buffer containing the file.
8. Stop the macro definition using the macro-menu of `Ctrl-X )' if
using emacs emulation.
9. Now move around the buffer and mark some text. Execute the macro
via menu or `Ctrl-X e' if using emacs emulation.
If you do this often, you should create a function such as the following:
define cut_to_scratch_buffer ()
{
check_region (0);
variable buf = whatbuf ();
variable str = bufsubstr_delete ();
setbuf ("*scratch*");
eob ();
insert (str);
newline ();
setbuf (buf);
}
--John
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
[2014 date index]
[2014 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]