all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* RE: How to PICK the CTRL-u argument from the file or some other method, with EXAMPLE
@ 2004-09-23 17:01 JayBingham
  0 siblings, 0 replies; 9+ messages in thread
From: JayBingham @ 2004-09-23 17:01 UTC (permalink / raw)


On Wednesday, September 22, 2004 8:06 PM Jose Cuthberto wrote:

> Suppose you want to paste a single killed line 
> (in kill buffer using two C-k's)
> you can trivially do it like this:
> 
> C-u 2 C-y
> 
> In this case you had to enter the numbers.
> 
> I have a file like this:
> 
> 5
> line1
> 6
> line2
> 
> Now I must convert it to a file with 5 line1's and 6 line2's and so
on.
> It is a long file.
> 
> How do I pick 5 and put it into C-u so that it is done 5 times.
> 
> I can write macros. and I can also write single line lisp
functions.
> Unfortunately there is no yank cammand that can take the argument
5.
> nor do i know the lisp function that can take the count and pass it
to 
> lisp function yank. I would want to avoid writing a loops, and vars
etc.

I don't know which version of emacs you are using or if you are even
using emacs, but in emacs 21.2 what it appears that you describe as
occurring when you type C-u 2 C-y is not what happens when I type the
same.  What does happen is that the second most recent item in the
kill ring is inserted into the buffer, not two copies of the most
recent item in the kill ring.

So assuming that you are using emacs, I don't think that you can do
what you think you want to do in the way you think you want to do it.
 IMHO it looks to me like you just need overcome your fear of loops
and to learn how to write elisp functions.  It is all that painful.
;)

If you need help learning how to program emacs lisp there are
tutorials on the web.  I did a quick search for "emacs lisp"+tutorial
and found at least 33 sites that matched, including the one on the
GNU site at:
http://www.gnu.org/software/emacs/emacs-lisp-intro/html_mono/emacs-lisp-intro.html.

You should have access to the Emacs Lisp Reference Manual.  Some sites
put it in the info directory so it is available when you type C-h i,
if yours does not it is available on the web at:
http://www.gnu.org/software/emacs/elisp-manual/

<Send replies only to the list not to this address>

-_
J_)
C_)ingham
.    Hewlett-Packard
.    Austin, TX
. “Language is the apparel in which your thoughts parade in public.
.  Never clothe them in vulgar and shoddy attire.”     -Dr. George W.
Crane-

^ permalink raw reply	[flat|nested] 9+ messages in thread
* How to PICK the CTRL-u argument from the file or some other method, with EXAMPLE
@ 2004-09-23  1:05 Jose Cuthberto
  2004-09-23 22:02 ` Jose Cuthberto
  0 siblings, 1 reply; 9+ messages in thread
From: Jose Cuthberto @ 2004-09-23  1:05 UTC (permalink / raw)


An example would clarify the problem:

Suppose you want to paste a single killed line (in kill buffer using two C-k's)
you can trivially do it like this:

C-u 2 C-y

In this case you had to enter the numbers.

I have a file like this:

5
line1
6
line2

Now I must convert it to a file with 5 line1's and 6 line2's and so on.
It is a long file.

How do I pick 5 and put it into C-u so that it is done 5 times.

I can write macros. and I can also write single line lisp functions.
Unfortunately there is no yank cammand that can take the argument 5.
nor do i know the lisp function that can take the count and pass it to 
lisp function yank. I would want to avoid writing a loops, and vars etc.

Thanks to the star who can help!!!

jose

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-09-24 19:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-23 17:01 How to PICK the CTRL-u argument from the file or some other method, with EXAMPLE JayBingham
  -- strict thread matches above, loose matches on Subject: below --
2004-09-23  1:05 Jose Cuthberto
2004-09-23 22:02 ` Jose Cuthberto
2004-09-23 22:08   ` Chris F.A. Johnson
2004-09-23 22:50     ` David Golden
2004-09-23 23:42   ` Johan Ur Riise
2004-09-24  7:19   ` Joakim Hove
2004-09-24 18:46   ` Greg Hill
2004-09-24 19:12     ` Greg Hill

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.