help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Annoying kill-ring behavior


From: Smith_RS
Subject: Re: Annoying kill-ring behavior
Date: Thu, 3 Apr 2014 14:59:55 -0700 (PDT)
User-agent: G2/1.0

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. :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]