3 ;;; make mouse-based paste ignore the mouse position and use the emacs point
4 ;;; instead. Make cut-text set the mark so the mouse can be used naturally
5 ;;; to select a region (e.g. to indent code).
7 ;;; Jean-Francois Lamy 1989-09-21
8 ;;; lamy@ai.utoronto.ca
10 (require 'x-mouse); These two lines
11 (provide 'x-fix-mouse); added by 89iwj@eng.cam.ac.uk
13 (defun x-cut-text (arg &optional kill)
14 "Copy text between point and mouse into window system cut buffer.
15 Set mark to current mouse position. Save in Emacs kill ring also."
16 (if (coordinates-in-window-p arg (selected-window))
18 (x-mouse-set-mark arg)
19 (let ((beg (point)) (end (mark)))
20 (x-store-cut-buffer (buffer-substring beg end))
21 (copy-region-as-kill beg end)
22 (if kill (delete-region beg end))))
23 (message "Mouse not in selected window")))
25 (defun x-paste-text (arg)
26 "Insert window system cut buffer contents at current point."
27 (insert (x-get-cut-buffer)))
29 (defun x-cut-and-wipe-text (arg)
30 "Kill text between point and mark; also copy to window system cut buffer."
33 (defun x-cut-text-if-moved (arg &optional kill)
34 (let ((opoint (point)))
35 (x-mouse-set-point arg)
37 ((not (equal (point) opoint))
39 (x-cut-text arg kill)))))
41 ;------- End of Forwarded Message