How to remove top entry (pop) from kill-ring emacs?

I need to replace the top dead line with another. I can (yank) this and then (kill-region ...), but after that there will be two lines: old and my new. How to completely delete an old entry from kill-ring?

+4
source share
3 answers

It can be as simple as

(pop kill-ring) 
+7
source

I'm not sure why you think Oleg’s answer is β€œnot a good style,” but here’s another way:

 (when kill-ring (setq kill-ring (cdr kill-ring))) 

You can also configure kill-ring-yank-pointer :

 (when kill-ring-yank-pointer (setq kill-ring-yank-pointer kill-ring)) 
0
source

My or (browse-kill-ring) to enter kill-ring mode, and then press "h" for help. One of the entries:

 d browse-kill-ring-delete 

so just hit β€œd” with the cursor over the entry to delete.

0
source

Source: https://habr.com/ru/post/1443005/


All Articles