Buy the book!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
kill-ring-yank-pointer points to the
beginning of the kill ring, and the argument passed to
rotate-yank-pointer is 1, the
% expression returns 1:
(- length (length kill-ring-yank-pointer)) => 0
(+ arg (- length (length kill-ring-yank-pointer))) => 1
(% (+ arg (- length (length kill-ring-yank-pointer))) length) => 1
regardless of the value of
As a result of this, the
setq kill-ring-yank-pointer expression
(setq kill-ring-yank-pointer (nthcdr 1 kill-ring))
What it does is now easy to understand. Instead of pointing as it did
to the first element of the kill ring, the
kill-ring-yank-pointer is set to point to the second element.
Clearly, if the argument passed to
rotate-yank-pointer is two, then
kill-ring-yank-pointer is set to
(nthcdr 2 kill-ring);
and so on for different values of the argument.
Similarly, if the
kill-ring-yank-pointer starts out pointing to
the second element of the kill ring, its length is shorter than the
length of the kill ring by 1, so the computation of the remainder is
based on the expression
(% (+ arg 1) length). This means that
kill-ring-yank-pointer is moved from the second element of
the kill ring to the third element if the argument passed to
rotate-yank-pointer is 1.
|webmaster donations bookstore||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|