emacs-devel
[Top][All Lists]
Advanced

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

Re: kill-new may replace the wrong item


From: Leo
Subject: Re: kill-new may replace the wrong item
Date: Wed, 2 Jun 2010 22:33:28 +0100

On 2 June 2010 20:53, Juri Linkov <address@hidden> wrote:
> Do you think `kill-do-not-save-duplicates' should take into account
> clipboard strings too and don't allow duplicates from clipboard?
> Maybe.  But should the same logic apply to the menu items of yank-menu?
> Should `menu-bar-update-yank-menu' use the value of `(car kill-ring)'
> that was *before* pushing clipboard into kill-ring, but the value of
> `replace' that is *after* pushing clipboard into kill-ring and
> comparing it with the new value of `(car kill-ring)'?

All I am trying to point out is there's something incorrect there.
When it detects the CAR is the same as the 'STRING' arg, there's
enough information to do something about it already, i.e.:

   (when (and kill-do-not-save-duplicates
              (equal string (car kill-ring)))
-    (setq replace t))
+    (pop kill-ring))
   (if (fboundp 'menu-bar-update-yank-menu)
       (menu-bar-update-yank-menu string (and replace (car kill-ring))))
   (when save-interprogram-paste-before-kill

is the old way of setting REPLACE to T is for the convenience of
menu-bar-update-yank-menu?

> --
> Juri Linkov
> http://www.jurta.org/emacs/

Leo



reply via email to

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