# HG changeset patch # User Per Bothner # Date 795320604 0 # Node ID 8d2f156b72ffcbcd62a1926922fc7347bd299c5d # Parent 4b411b6a4e704206ce4f8a5e35e0bb47b1d522a6 (term-mouse-paste): Make work for xemacs. Minor GNU emacs fixes. diff -r 4b411b6a4e70 -r 8d2f156b72ff lisp/term.el --- a/lisp/term.el Thu Mar 16 01:24:19 1995 +0000 +++ b/lisp/term.el Thu Mar 16 02:23:24 1995 +0000 @@ -670,12 +670,18 @@ (defun term-mouse-paste (click arg) "Insert the last stretch of killed text at the position clicked on." (interactive "e\nP") - (mouse-set-point click) - (setq this-command 'yank) - (term-send-raw-string (current-kill (cond - ((listp arg) 0) - ((eq arg '-) -1) - (t (1- arg)))))) + (term-if-xemacs + (term-send-raw-string (or (condition-case () (x-get-selection) (error ())) + (x-get-cutbuffer) + (error "No selection or cut buffer available")))) + (term-ifnot-xemacs + ;; Give temporary modes such as isearch a chance to turn off. + (run-hooks 'mouse-leave-buffer-hook) + (setq this-command 'yank) + (term-send-raw-string (current-kill (cond + ((listp arg) 0) + ((eq arg '-) -1) + (t (1- arg))))))) ;; Which would be better: "\e[A" or "\eOA"? readline accepts either. (defun term-send-up () (interactive) (term-send-raw-string "\e[A"))