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: Thu, 3 Apr 2014 14:59:55 -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 1396562441 20783 80.91.229.3 (3 Apr 2014 22:00:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2014 22:00:41 +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 00:00:34 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 1WVpgX-0000QZ-FP for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Apr 2014 00:00:33 +0200 Original-Received: from localhost ([::1]:46557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVpgX-0003gp-6A for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Apr 2014 18:00:33 -0400 X-Received: by 10.236.181.229 with SMTP id l65mr5240887yhm.28.1396562396217; Thu, 03 Apr 2014 14:59:56 -0700 (PDT) X-Received: by 10.50.29.110 with SMTP id j14mr540604igh.5.1396562396085; Thu, 03 Apr 2014 14:59:56 -0700 (PDT) Original-Path: usenet.stanford.edu!w5no74853qac.0!news-out.google.com!gi6ni171igc.0!nntp.google.com!l13no2456884iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <21e35a20-5eec-4f1b-a376-d9d2fe034840@googlegroups.com> 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: Thu, 03 Apr 2014 21:59:56 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:204687 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:96957 Archived-At: On Thursday, April 3, 2014 9:52:17 AM UTC-7, Smith_RS wrote: > When I try to update the kill-ring "by hand" I find that when I try to access yank-menu it is no longer in sync with the kill-ring. > > How do I fix that? The code in menu-bar.el doesn't really explain how it's kept in sync. What am I missing? Is there a hook somewhere? Never mind, I figured it out. (progn (setq kill-ring (delete "" kill-ring)) (setq kill-ring-yank-pointer kill-ring) (setq yank-menu '("Yank Menu")) (fset 'yank-menu (cons 'keymap yank-menu)) (dolist (my-string kill-ring) (menu-bar-update-yank-menu my-string nil))) Life of a programmer, all that effort for just six lines of code that no one else will ever notice. :)