Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How does one clear the kill ring in emacs? I use browse-kill-ring.el but the buffer it provides is read-only.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

For me, M-: (setq kill-ring nil) works. See also Internals of Kill Ring in the elisp manual. Don't ask me about side effects and security aspects, though.

Invoking the garbage collection right away as in

(progn (setq kill-ring nil) (garbage-collect))

makes the conses less accessible, so this might give you some degree of security.

share|improve this answer
    
Thanks, that's quite practical. I don't know enough about the internals of emacs memory management but I would guess setting a variable to nil doesn't guarantee deleting the contents from memory. So naturally, my next question would be about the security implications of this but you beat me to it :-). Googling about this gives me surprisingly little info. Am I the only one editing "sensitive" files with emacs? –  Stefanos Klironomos Feb 5 '13 at 11:52
    
Maybe garbage collecting makes the list cells less accessible? See the modified answer. –  artistoex Feb 9 '13 at 11:27
    
I guess that's the best bet. Thanks. –  Stefanos Klironomos Feb 9 '13 at 14:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.