From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Smith_RS Newsgroups: gmane.emacs.help Subject: Re: Annoying kill-ring behavior Date: Fri, 4 Apr 2014 00:00:43 -0700 (PDT) Message-ID: References: <21e35a20-5eec-4f1b-a376-d9d2fe034840@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1396595126 17145 80.91.229.3 (4 Apr 2014 07:05:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Apr 2014 07:05:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 04 09:05:21 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WVyBk-0006fR-LO for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Apr 2014 09:05:20 +0200 Original-Received: from localhost ([::1]:47978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVyBk-0001HK-5R for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Apr 2014 03:05:20 -0400 X-Received: by 10.43.126.2 with SMTP id gu2mr6623826icc.0.1396594843825; Fri, 04 Apr 2014 00:00:43 -0700 (PDT) X-Received: by 10.50.30.66 with SMTP id q2mr44662igh.1.1396594843733; Fri, 04 Apr 2014 00:00:43 -0700 (PDT) Original-Path: usenet.stanford.edu!l13no2535751iga.0!news-out.google.com!xg2ni98igc.0!nntp.google.com!ur14no2137540igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=12.189.199.68; posting-account=FPshOQoAAABhQbXLwYlqquO5tX-UXyrO Original-NNTP-Posting-Host: 12.189.199.68 User-Agent: G2/1.0 Injection-Date: Fri, 04 Apr 2014 07:00:43 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:204694 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96964 Archived-At: On Thursday, April 3, 2014 9:34:25 PM UTC-7, Joost Kremers wrote: > Did you check the doc string of `kill-ring'? There, you'll find the > warning not to use that variable directly. There are functions to update > the kill ring that you should use instead: [ ... ] > And although it doesn't say so, looking at the source shows that > the yank menu is also updated. I know, I wanted to see if it could be done. But you raise a valid point. What I found was that if I modified kill-ring I had to also modify kill-ring-yank-pointer. In the simplest case you can do this, and get a clean slate: (setq kill-ring nil) (setq kill-ring-yank-pointer nil) If you edit the kill-ring like this (my original problem was empty strings): (setq kill-ring (remove "" kill-ring)) You have to do this: (setq kill-ring-yank-pointer kill-ring) These two web pages were helpful http://www.gnu.org/software/emacs/manual/html_node/eintr/kill_002dnew-function.html http://www.gnu.org/software/emacs/manual/html_node/eintr/kill_002dring_002dyank_002dpointer.html So, yes, I'm still confused about what the real difference is between kill-ring and kill-ring-yank-pointer, but I was able to get the behavior I wanted. It took some more digging to fix yank-menu, but I got this to work: (setcdr yank-menu nil) (dolist (str kill-ring) (menu-bar-update-yank-menu str nil)) (setcdr yank-menu (reverse (cdr yank-menu))) Try it for yourself. :)