]> git.eshelyaron.com Git - emacs.git/commitdiff
Tom Horsley <tom.horsley at att.net>
authorGlenn Morris <rgm@gnu.org>
Thu, 18 Oct 2007 04:52:15 +0000 (04:52 +0000)
committerGlenn Morris <rgm@gnu.org>
Thu, 18 Oct 2007 04:52:15 +0000 (04:52 +0000)
(interprogram-paste-function): Doc fix.
(current-kill): Accept list of strings as well
as single string from `interprogram-paste-function'.

lisp/ChangeLog
lisp/simple.el

index c1603b12907bf225ea92ba7bd9e91257f825e6c2..b4d5f159adfcfd788fcff3ca25a3e823bb253cf1 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-15  Tom Horsley  <tom.horsley@att.net>
+
+       * simple.el (interprogram-paste-function): Doc fix.
+       (current-kill): Accept list of strings as well
+       as single string from `interprogram-paste-function'.
+
 2007-10-18  Glenn Morris  <rgm@gnu.org>
 
        * ibuf-ext.el (ibuffer-saved-filter-groups): Doc fix.
index 3d5f6bfab10c2189be09f8ce4cb230a4c4282066..ebf0a5ff71ebb03aad2ac5f412d400923bad4e1e 100644 (file)
@@ -2564,6 +2564,11 @@ of the Emacs kill ring should be used.  If the function returns a
 string, then the caller of the function \(usually `current-kill')
 should put this string in the kill ring as the latest kill.
 
+This function may also return a list of strings if the window
+system supports multiple selections. The first string will be
+used as the pasted text, but the other will be placed in the
+kill ring for easy access via `yank-pop'.
+
 Note that the function should return a string only if a program other
 than Emacs has provided a string for pasting; if Emacs provided the
 most recent string, the function should return nil.  If it is
@@ -2647,11 +2652,11 @@ If `interprogram-cut-function' is set, pass the resulting kill to it."
 
 (defun current-kill (n &optional do-not-move)
   "Rotate the yanking point by N places, and then return that kill.
-If N is zero, `interprogram-paste-function' is set, and calling it
-returns a string, then that string is added to the front of the
-kill ring and returned as the latest kill.
-If optional arg DO-NOT-MOVE is non-nil, then don't actually move the
-yanking point; just return the Nth kill forward."
+If N is zero, `interprogram-paste-function' is set, and calling it returns a
+string or list of strings, then that string (or list) is added to the front
+of the kill ring and the string (or first string in the list) is returned as
+the latest kill.  If optional arg DO-NOT-MOVE is non-nil, then don't
+actually move the yanking point; just return the Nth kill forward."
   (let ((interprogram-paste (and (= n 0)
                                 interprogram-paste-function
                                 (funcall interprogram-paste-function))))
@@ -2661,8 +2666,10 @@ yanking point; just return the Nth kill forward."
          ;; text to the kill ring, so Emacs doesn't try to own the
          ;; selection, with identical text.
          (let ((interprogram-cut-function nil))
-           (kill-new interprogram-paste))
-         interprogram-paste)
+           (if (listp interprogram-paste)
+             (mapc 'kill-new (nreverse interprogram-paste))
+             (kill-new interprogram-paste)))
+         (car kill-ring))
       (or kill-ring (error "Kill ring is empty"))
       (let ((ARGth-kill-element
             (nthcdr (mod (- n (length kill-ring-yank-pointer))