www.delorie.com/gnu/docs/emacs-lisp-intro/emacs-lisp-intro_150.html   search  
Buy the book!

Programming in Emacs Lisp

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10. Yanking Text Back

Whenever you cut text out of a buffer with a `kill' command in GNU Emacs, you can bring it back with a `yank' command. The text that is cut out of the buffer is put in the kill ring and the yank commands insert the appropriate contents of the kill ring back into a buffer (not necessarily the original buffer).

A simple C-y (yank) command inserts the first item from the kill ring into the current buffer. If the C-y command is followed immediately by M-y, the first element is replaced by the second element. Successive M-y commands replace the second element with the third, fourth, or fifth element, and so on. When the last element in the kill ring is reached, it is replaced by the first element and the cycle is repeated. (Thus the kill ring is called a `ring' rather than just a `list'. However, the actual data structure that holds the text is a list. See section Handling the Kill Ring, for the details of how the list is handled as a ring.)

10.1 Kill Ring Overview  The kill ring is a list.
10.2 The kill-ring-yank-pointer Variable  The kill-ring-yank-pointer variable.
10.3 Exercises with yank and nthcdr  

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003