8

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

10

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.

  • 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? – kliron 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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