emacs-devel
[Top][All Lists]
Advanced

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

Re: kill-new discards current X selection


From: Jan D.
Subject: Re: kill-new discards current X selection
Date: Wed, 26 Aug 2009 20:41:01 +0200

I for one would be very surprised if the X selection popped up in the kill-ring just because I made a kill in Emacs.

An option to tell Emacs to grab the primary X selection only when something is selected with the mouse would be nice. Maybe there already exists one. I assume you mean the primary selection?

       Jan D.

26 aug 2009 kl. 18.18 skrev Sam Steingold <address@hidden>:

When I select a word in an xterm and then kill in emacs, then X selection is gone forever, replaced with the emacs kill. The appended patch prepends the current X selection to kill-ring before replacing the X selection with the current Emacs kill. Is it OK to install it unconditionally, or is it better to guard it with a user option, e.g., save-interprogram-paste-before-kill?


--- simple.el.~1.1005.~    2009-08-25 16:44:36.000000000 -0400
+++ simple.el    2009-08-26 12:15:19.000123000 -0400
@@ -2819,6 +2819,13 @@ argument should still be a \"useful\" st
       (list string "yank-handler specified for empty string"))))
  (if (fboundp 'menu-bar-update-yank-menu)
(menu-bar-update-yank-menu string (and replace (car kill- ring))))
+  (let ((interprogram-paste (and interprogram-paste-function
+                 (funcall interprogram-paste-function))))
+    (when interprogram-paste
+      (if (listp interprogram-paste)
+        (dolist (s (nreverse interprogram-paste))
+          (push s kill-ring))
+        (push interprogram-paste kill-ring))))
  (if (and replace kill-ring)
      (setcar kill-ring string)
    (push string kill-ring)






reply via email to

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