Function: xscheme-yank-pop
xscheme-yank-pop is an interactive and byte-compiled function defined
in xscheme.el.gz.
Signature
(xscheme-yank-pop ARG)
Documentation
Insert or replace a just-yanked expression with an older expression.
If the previous command was not a yank, it yanks.
Otherwise, the region contains a stretch of reinserted
expression. yank-pop deletes that text and inserts in its
place a different expression.
With no argument, the next older expression is inserted. With argument n, the n'th older expression is inserted. If n is negative, this is a more recent expression.
The sequence of expressions wraps around, so that after the oldest one comes the newest one.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/xscheme.el.gz
(defun xscheme-yank-pop (arg)
"Insert or replace a just-yanked expression with an older expression.
If the previous command was not a yank, it yanks.
Otherwise, the region contains a stretch of reinserted
expression. `yank-pop' deletes that text and inserts in its
place a different expression.
With no argument, the next older expression is inserted.
With argument n, the n'th older expression is inserted.
If n is negative, this is a more recent expression.
The sequence of expressions wraps around, so that after the oldest one
comes the newest one."
(interactive "*p")
(setq this-command 'xscheme-yank)
(if (not (eq last-command 'xscheme-yank))
(progn
(xscheme-yank)
(setq arg (- arg 1))))
(if (not (= arg 0))
(let ((before (< (point) (mark))))
(delete-region (point) (mark))
(xscheme-rotate-yank-pointer arg)
(set-mark (point))
(insert (car xscheme-expressions-ring-yank-pointer))
(if before (exchange-point-and-mark)))))