diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-03 16:03:38 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-03 16:03:38 -0700 |
commit | b49e353d9d01adbe60bc5d0b1658b4ef978b0b06 (patch) | |
tree | 9f2ffa6f7a6562abf661a4951012b488ad8b1ae7 /lisp/term.el | |
parent | 74b880cbc18bd0194c7b1fc44c4a983ee05adae2 (diff) | |
parent | bc3200871917d5c54c8c4299a06bf8f8ba2ea02d (diff) | |
download | emacs-b49e353d9d01adbe60bc5d0b1658b4ef978b0b06.tar.gz |
Merge from trunk.
Diffstat (limited to 'lisp/term.el')
-rw-r--r-- | lisp/term.el | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lisp/term.el b/lisp/term.el index 6d7f6f5c535..361ff685396 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1227,9 +1227,9 @@ without any interpretation." (make-string 1 char) (format "\e%c" char))))) -(defun term-mouse-paste (click arg) - "Insert the last stretch of killed text at the position clicked on." - (interactive "e\nP") +(defun term-mouse-paste (click) + "Insert the primary selection at the position clicked on." + (interactive "e") (if (featurep 'xemacs) (term-send-raw-string (or (condition-case () (x-get-selection) (error ())) @@ -1238,10 +1238,17 @@ without any interpretation." (run-hooks 'mouse-leave-buffer-hook) (setq this-command 'yank) (mouse-set-point click) - (term-send-raw-string (current-kill (cond - ((listp arg) 0) - ((eq arg '-) -1) - (t (1- arg))))))) + (term-send-raw-string + (or (cond ; From `mouse-yank-primary': + ((eq system-type 'windows-nt) + (or (x-get-selection 'PRIMARY) + (x-get-selection-value))) + ((fboundp 'x-get-selection-value) + (or (x-get-selection-value) + (x-get-selection 'PRIMARY))) + (t + (x-get-selection 'PRIMARY))) + (error "No selection is available"))))) (defun term-paste () "Insert the last stretch of killed text at point." |