Questions tagged [kill-ring]

The kill ring is a list of blocks of text that were previously killed.

The kill ring is a list of blocks of text that were previously killed.

There is only one kill ring, shared by all buffers, so you can kill text in one buffer and yank it in another buffer. This is the usual way to move text from one buffer to another. (There are several other methods: for instance, you could store the text in a register; see Registers. See Accumulating Text, for some other ways to move text around.)

The maximum number of entries in the kill ring is controlled by the variable kill-ring-max. The default is 60. If you make a new kill when this limit has been reached, Emacs makes room by deleting the oldest entry in the kill ring.

The actual contents of the kill ring are stored in a variable named kill-ring; you can view the entire contents of the kill ring with C-h v kill-ring.

Reference: https://www.gnu.org/software/emacs/manual/html_node/emacs/Kill-Ring.html

8 questions
15
votes
6 answers

on Emacs for OSX, how to keep kill ring and clipboard separate?

In GNU Emacs for OSX, how can I keep the kill ring and OSX clipboard separate? (Such that I essentially have two separate kill rings.) With desired behavior, this would work: 1. ⌘C to copy text from the web to OSX clipboard. 2. controlk to kill a…
incandescentman
  • 6,168
  • 3
  • 46
  • 86
12
votes
1 answer

insert something into kill ring in Emacs

I want to write a function that will insert the file name of the current buffer into the kill ring so I can yank it to the terminal in another window. How can I programmatically insert a string into the kill ring? (
jcubic
  • 61,973
  • 54
  • 229
  • 402
3
votes
3 answers

emacs: put S-Expression to kill ring without removing it

I'm looking for a command to put an S-expression to the kill ring, without removing it. The following scenario would do the thing, however the expression would be removed, when using M-x kill-sexp: (foo (bar bam)) ^ point here
Anton Harald
  • 5,772
  • 4
  • 27
  • 61
2
votes
1 answer

Accessing OS X kill ring programmatically

I recently noticed, that OS X has another clipboard which you can access by killing something with ctrl + K and then yanking it with ctrl + Y. I know I can access OS Xs normal clipboard with pbcopy and pbpaste. Sadly you cannot access the kill ring…
hgiesel
  • 5,430
  • 2
  • 29
  • 56
1
vote
1 answer

Emacs: delete-region doesn't delete

The delete-region command in Emacs doesn't behave as expected. It sends the region to the kill-ring, even though it shouldn't. While deleting one character at a time with delete-backward-char works as expected, i.e. it doesn't send the character to…
Nicomachus
  • 39
  • 4
1
vote
1 answer

What's wrong with this elisp function?

I write a elisp function to copy the current line if no region has be selected, but it does not work on emacs 24.5. When I hit the "M-w" keystrokes , there comes a message "Mark set" in the minibuffer. Did I miss something? (defun…
Elinx
  • 1,196
  • 12
  • 20
1
vote
1 answer

Using X11 clipboard in Emacs instance inside gnome-terminal

I am using Emacs 24.5.1 from the Gnome Terminal in Arch Linux. When I copy text from outside the Gnome Terminal window (from any other X window, e.g. Firefox), it is not available in the Emacs kill-ring. I have tried (setq x-select-enable-clipboard…
dpc
  • 41
  • 1
  • 4
0
votes
1 answer

Kill ring bash shortcuts on Visual Studio Code terminal

in Visual Studio Code (for mac) it doesn't seem to work the kill ring shortcuts on the bash terminal. I mean things like kill to right with ^K and to left ^U etc. However ^A does move the caret to the beginning and ^L does clean the screen, etc I…