[comp.emacs] Yanking N Times

dhm@sei.cmu.edu (Daniel Miller) (03/18/88)

How do I yank the most recent kill N times?  [Of course, C-U N C-Y doesn't
do it since that yanks the Nth most recent kill one time.]

How do I yank the Mth most recent kill N times? [???]

Jus' wondering...

... Daniel "Dan" H. Miller                       Above opinions are my own
Software Engineering Inst.; Carnegie-Mellon U.; Pittsburgh PA 15213; _USA_
dhm@sei.cmu.edu                                           + 1 412 268-7728

wolfgang@mgm.mit.edu (Wolfgang Rupprecht) (03/18/88)

In article <4622@aw.sei.cmu.edu> dhm@sei.cmu.edu (Daniel Miller) writes:
>How do I yank the most recent kill N times?  [Of course, C-U N C-Y doesn't
>do it since that yanks the Nth most recent kill one time.]

How about "C-X ( C-Y C-X ) C-U <n-1> C-X e"

For a translation into English: 
1) start keyboard marco
2) (macro) Yank
3) End keyboard macro
4) Universal arg (n-1 times)
5) execute keyboard macro

Wolfgang Rupprecht	ARPA:  wolfgang@mgm.mit.edu (IP 18.82.0.114)
326 Commonwealth Ave.	UUCP:  mit-eddie!mgm.mit.edu!wolfgang
Boston, Ma. 02115	TEL:   (617) 267-4365

mark@comp.vuw.ac.nz (Mark Davies) (03/19/88)

In article <4622@aw.sei.cmu.edu> dhm@sei.cmu.edu (Daniel Miller) writes:
>How do I yank the most recent kill N times?  [Of course, C-U N C-Y doesn't
>do it since that yanks the Nth most recent kill one time.]
>
>How do I yank the Mth most recent kill N times? [???]

On the odd times I want to do this I just perform the yank in a keyboard
macro and then give the prefix arg to the call-last-kbd-macro command.
ie.
	C-x(C-yC-x)M-<N-1>C-xe		where <N-1> represents the
					appropriate argument - 1

Of course if N is small its not worth it.
-- 
Domainised:  mark@comp.vuw.ac.nz	Bang form: ...!uunet!vuwcomp!mark

jr@PEBBLES.BBN.COM (John Robinson) (03/21/88)

In article <4622@aw.sei.cmu.edu> dhm@sei.cmu.edu (Daniel Miller) writes:
>How do I yank the Mth most recent kill N times? [???]

In case you can't figure this out from the previous responders:

^U M ^Y ^W ^X ( ^Y ^X ) ^U N-1 ^X e

or maybe (if you're convinced you know M):

^X ( ^U M ^Y ^X ) ^U N-1 ^X e

/jr
jr@bbn.com or jr@bbn.uucp