the kill-ring

Last time, I discussed registers, and mentioned the kill-ring. The kill-ring is the 'normal' clipboard emacs uses for cut/copy/paste of text. The cool name comes from the fact that in emacs terminology, 'killing' means what 'cutting' means in many other programs. The kill-ring contains the cut (and copied!) text parts; cut-copy-paste have their own entry.

As mentioned in the registers entry, many programs only allow you to paste the last copied/cut text block, and that is what the kill-ring does by default (when you press C-y). However, you can choose older ones using the menu (Edit/Paste from kill menu). Alternatively, you can use a prefix key (e.g., M-3 C-y will insert the third most recently killed ('cut') text).

The kill 'ring' behaves mostly like a list; by default (emacs 22, 23) there are 60 positions available in the ring, after which older entries are thrown away. You can put (setq kill-ring-max 120) in your .emacs in the unlikely case that 60 is not enough.

Update:An anonymous commenter mentions the useful M-y ('yank-pop') key binding, which lets you cycle through the items in the kill-ring. Quite useful indeed, thanks!

If you're using the GTK+-version of emacs (the graphical version in X/Linux/Unix environments), you can even have the Edit/Paste from kill menu-menu in a separate frame (window), and paste text by clicking there. To this, go to the menu Edit/Paste from kill menu, and click on the dotted line at the top of the sub menu.

No comments:

Post a Comment

Followers

Popular Posts