Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [kill-ring]

The kill ring is a global list of blocks of text that were previously copied or moved from buffers.

1
vote
2answers
27 views

Rotate the yanking ring

I have such a table | C | M | |---------------------+---------------------| | Character | Word | |---------------------+----------...
3
votes
1answer
27 views

How to copy output from ess to the kill ring?

Q: how can I automatically copy output from ess to the kill ring? Background I use ess to conduct statistical analysis. On occasion, I need to copy its raw output into another buffer (usually ...
0
votes
1answer
30 views

Why isn't the flushed output from my Emacs shell buffer getting into the kill ring?

Following the advice given on p. 121 of Learning GNU Emacs, 2nd Ed., I'm entering the command sequence: C-c C-o, immediately after executing a command in my Emacs shell buffer. And I'm seeing the ...
3
votes
0answers
25 views

string-rectangle command pollutes kill-ring after upgrade to Emacs 25

In Emacs 24 I used to have a workflow for inserting a string into multiple lines at once: Go to the desired position in the first line. Press C-Space to place the mark. Go to the last line (while ...
0
votes
1answer
49 views

Trying to copy everything between double quotes, and then make a list of everything that was copied

So I have a defun that I made that is supposed to copy every thing that is between double quotes and then make a list of everything that was copied. I don't know what the problem is, but it doesn't ...
0
votes
0answers
29 views

Unable to run browse-kill-ring

After installing the browse-kill-ring package under Emacs 24.5.1, I get the following error when running the browse-kill-ring command: font-lock-set-defaults: Wrong type argument: symbolp, (font-...
0
votes
0answers
37 views

helm-show-kill-ring disregards the selection

When I select entries (with C-<SPACE>) in helm-show-kill-ring and press either Enter or F1, it disregards the selection and yanks the entry currently under cursor. Why would this be the case and ...
2
votes
1answer
101 views

yanking earlier kills not working

I followed the tutorial verbatim and I am unable to yank earlier kills. I have looked online for support, but noone else seems to have this problem. Kill a line, move around, kill another line. ...
0
votes
1answer
37 views

Yanking line copies past kill-ring lines along with current

I'm using Emacs to create text to copy to another program, but I need to copy line by line. I'm using a variation of kill-ring-save I provide below. (defun my-kill-ring-save () (interactive) ...
1
vote
2answers
54 views

save-whole-line

kill-whole-line works as I want. It cuts the line, and when I'm in org-mode it cuts the whole collapsed subtree. What I need is just that as copy instead of cut. There is a multitude of suggestions ...
1
vote
1answer
110 views

How copy content of minibuffer to kill-ring?

Windows 10, Emacs 25, Helm How copy content of minibuffer to kill-ring?
0
votes
0answers
195 views

Wanted: vim-like paste behavior from browse-kill-ring

When using the browse-kill-ring package to insert some text from the kill ring, the text always gets inserted before point. This is not intuitive to vim users who are used to pasted text being ...
1
vote
5answers
76 views

Gathering scattered text to a single location

I am looking for an easy way to gather blocks of text that are scattered throughout an emacs or org-mode document and move (or copy, but move would be preferred) them to a single location. (For ...
1
vote
2answers
32 views

How to capture show-paren-mode region into the kill ring?

I'm enjoying show-paren-mode using the "expression" style, which highlights a parenthesized region in a contrasting color. I'd like to define an Emacs Lisp function that could capture the region into ...
0
votes
1answer
62 views

evil “exchange-with-kill-ring”-operator?

I often find myself wanting to exchange some text object with whatever's currently in CLIPBOARD (not necessarily in Emacs' kill-ring, when I copy from other programs). But of course when I do ...
1
vote
2answers
213 views

Copying an rectangular selection to system clipboard

Does anyone know a command or somtething to copy an rectangular selection (as with C-x r M-w / copy-rectange-as-kill) and put the killed rectangle into the system clipboard like with the kill-ring-...
0
votes
1answer
165 views

What's the most efficient, idiomatic way to paste-and-replace in Emacs?

I often do something like this: Copy some stuff Go to where I need to paste it Paste it (C-y) Kill the rest of the line (C-k) Select what I just pasted, and copy it again Repeat steps 2-5 The whole "...
1
vote
1answer
106 views

How can I use magit to diff some text with my clipboard?

I see others doing this in there IDEs is there a way to highlight a file or some text in a file and diff it with whats in my clipboard/kill-ring ?
0
votes
2answers
44 views

Function to duplicate and mark duplicated text

In order to be able to chain the following command, I need the yanked text to be marked. That is because the end goal is to call (pop kill-ring) so that I can still use whatever was at the top of the ...
0
votes
3answers
509 views

how can I get Emacs kill-ring to behave like a simple clipboard buffer?

How can I get Emacs to behave the same as other programs for copy/paste (i.e. OpenOffice, Microsoft Word, etc.)? I want to simplify the kill-ring so that it behaves like a simple clipboard. I find it ...
2
votes
1answer
254 views

How to send *shell* stdout directly to kill-ring?

Suppose that I have a *shell* buffer (i.e. a subordinate shell, started with M-x shell). Suppose also that at this shell's prompt, I can execute some command foo that sends some output to stdout. I ...
0
votes
2answers
2k views

Paste Windows clipboard with Shift-Insert but not by yanking

I am using Emacs 24.4 on Windows 10. I only ever use it in -nw (no-window) mode. I would like Emacs to paste from the Windows clipboard only on Shift-Insert and not on yank (Ctrl-y). I have tried ...
0
votes
1answer
348 views

What is the difference between kill-ring-save and copy-region-as-kill?

These two commands seem identical to me. What am I missing?
1
vote
0answers
44 views

Launch functions one after another

I wrote a function that pastes in the currently selected color from the palette to the buffer: (defun palette-paste-in-current-color () (interactive) (cua-paste (palette-current-rgb-to-kill-ring))...
5
votes
4answers
1k views

How do I yank and cycle backward through earlier killed text?

Emacs has this very handy kill-ring that can be cycled through after yanking, by pressing M-y repeatedly. Is there a way to switch the cycling direction? So I don not need to cycle through all when I ...
2
votes
3answers
716 views

In Evil mode, how can I prevent adding to the kill ring when I yank text, visual mode over other text, then paste over?

If I have text1 text2, I yank text1 with yw then I highlight text2 with vw and paste overwrite that text with p, my kill ring now has text2. I'd prefer if text2 wasn't added to my kill ring because ...
2
votes
2answers
75 views

How to avoid double M-y with system clipboard integration in the terminal

I added Mac clipboard integration to my emacs -nw using the following code, adapted from here: (defun copy-from-osx () (shell-command-to-string "pbpaste")) (defun paste-to-osx (text &optional ...
1
vote
2answers
200 views

Calc: copy only a value, not stack number

This seems so obvious that I feel sure that I've just missed something in the manual. I frequently do a calculation and then want to use that calculation elsewhere. But let's say my stack is currently:...
9
votes
3answers
794 views

Backspace without adding to kill ring

Using Crtl+Backspace or Ctrl+Del adds the deleted text to the kill ring. How can I prevent this from happening. I do not need to have every single piece of text sends to the kill ring, when it gets ...
3
votes
1answer
63 views

kill-region deletes entire buffer content instead of selected text

In emacs, i have a small text selected as shown in the picture. When i do eval-buffer, i like the kill-region to remove only the highlighted text. But this code empties the buffer. ;;this is a ...
3
votes
1answer
208 views

How to stop C-backspace or M-backspace from copying text?

Deleting a chunk of text from the cursor causes the deleted contents to be copied into the kill ring, overwriting whatever I had stored there. How do I stop this from happening?
10
votes
1answer
350 views

How to copy text without losing selection?

When I copy some selected text (kill-ring-save with M-w), I automatically lose my selection. I have tried with Transient Mark Mode with no luck. (Note that I'm not using CUA Mode.)
8
votes
2answers
1k views

How can I use Helm File Finder to copy a file path to a buffer?

Is there a way, in the buffer launched from helm-find-files, to copy a file path to the kill ring?
4
votes
0answers
161 views

What is the distinction between copying text between a region BEG/END, and copying a region?

I was trying to add a custom functionality when using C-u before the "copying" command or kill-ring-save. So I jumped into the source code (pasted below for convenience) to examine what it originally ...
0
votes
2answers
78 views

Copy current line if there is no active region [duplicate]

I wrote this custom function to copy the entire line, if no mark is set (defun sk-copy-ops (beg end) (interactive "r") (if mark-active (kill-ring-save beg end) (kill-ring-save (line-beginning-...
7
votes
3answers
438 views

How to push system clipboards to kill ring contents at real-time when I copy outside emacs?

I noticed that when I copy thing outside of Emacs, the thing does not appear to kill ring immediately except I yank it to Emacs. If I copy twice, only the last copy can be got by yank. Sometimes, I ...
6
votes
3answers
2k views

How can I copy syntax highlighted code as RTF or HTML?

I'm using Emacs to write code samples that I later want to be able to paste into a MS-Word document, preserving the syntax highlighting. I understand that in order to do this I need to copy the text ...
1
vote
0answers
21 views

Copy buffer absolute file path to the system clipboard [duplicate]

How can i copy the absolute path of the current open buffer to the system clipboard (i.e. ctrl + shift + v) and not (ctrl + y) There are many solutions available for such copy, 1 and 2 but all of ...
4
votes
1answer
452 views

how to push kill-ring contents onto system pasteboard (clipboard)?

I use the brilliant answer from my previous question to copy selected regions of text from Emacs onto my system pasteboard (i.e. the OSX clipboard). But some functions (e.g. gist-buffer) push output ...
3
votes
1answer
218 views

Modification of kill-ring-save to copy current word/line/whole buffer/ if no region is selected

I would like to write a function which on the first execution behaves like the regular kill-ring-save if some region is selected on the first execution copies the current word if no region is ...
2
votes
2answers
163 views

Any way to select a region using `S-down-mouse-1` without saving the region as a kill?

Using emacsw32. The usual suggested way to make a selection using S-down-mouse-1 is to bind that to mouse-save-then-kill. Is there a similar command which selects a region, but does not save the ...
1
vote
1answer
164 views

Kill a line deletes the line but leaves a blank newline character

On deleting a line in Emacs using C-k, Emacs removes the line contents but it leaves a blank newline character. To remove this, I again press C-k. How can I delete the complete line with no traces ...
4
votes
2answers
3k views

Evil: Is there a default register that does not get overwritten by later yanks to explicit registers?

I often use registers in evil, but I have a common use case that I cannot seem to resolve. I would like to have all copied text stored somewhere that does not get overwritten when I explicitly make ...
0
votes
0answers
392 views

Kill ring not synchronizing with clipboard in Windows

I have been using Emacs 24 on Windows 7 for almost a year without any issues. But recently, kill-ring in my Emacs has stopped synchronizing with clipboard (actually whatever I copy from within Emacs ...
8
votes
2answers
230 views

How do I filter kill-ring contents?

Is it possible to prevent kill-ring from storing whitespaces/empty lines? Right now after I do a couple of changes and then go to browse-kill-ring I often see something like this: ------- ------- ...
9
votes
2answers
1k views

Function to delete all comments from a buffer, without moving them to kill ring

I need to be able to remove all comments from a buffer from elisp code. For now, I am using: (goto-char (point-min)) (comment-kill (count-lines (point-min) (point-max))) However, comment-kill is an ...
2
votes
2answers
943 views

Is CUA Mode good over usual Emacs Cut and yank commands [closed]

Just wanted to capture the advantages of CUA mode over the usual emacs copy and paste commands. One advantage which is quite obvious is it similar to the keybindings which are present in other editors....
6
votes
1answer
325 views

how to move region to other window?

How can I automatically move selected to the other window? Trying to streamline my split-window workflow. Here's what I have so far. Doesn't work yet. (defun move-region-to-other-window (start end)...
0
votes
1answer
30 views

Scrolling seems to add an unwanted chunk into my kill ring

Anybody know why this may be occurring? Here is an outline of how I recreate the issue... I copy or kill something to my kill ring. I scroll up or down with the mouse. I then yank and get an ...
10
votes
3answers
325 views

How to copy killed rectangle to the kill ring

I frequently extract a rectangle of text from a buffer, but then find I want to yank the text as if it was not a rectangle. Is there a way to add the current killed rectangle to the kill ring? The ...