diff options
author | Per Bothner <bothner@cygnus.com> | 1995-03-16 02:23:24 +0000 |
---|---|---|
committer | Per Bothner <bothner@cygnus.com> | 1995-03-16 02:23:24 +0000 |
commit | aade4ab28e774bc2d74a6567aae24e805f30e78a (patch) | |
tree | ab97c8e75e84a56071d30a44b1f7736a87a51135 /lisp/term.el | |
parent | 5232b7532b34915d25d9d483eb36f75d5b7dd57e (diff) | |
download | emacs-aade4ab28e774bc2d74a6567aae24e805f30e78a.tar.gz |
(term-mouse-paste): Make work for xemacs. Minor GNU emacs fixes.
Diffstat (limited to 'lisp/term.el')
-rw-r--r-- | lisp/term.el | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/term.el b/lisp/term.el index 8d0e15e09eb..e21b354a9dd 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -670,12 +670,18 @@ without any interpretation." (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")) |