home *** CD-ROM | disk | FTP | other *** search
- x-gateway: rodan.UU.NET from bug-lucid-emacs to alt.lucid-emacs.bug; Thu, 17 Dec 1992 08:00:56 EST
- Date: 17 Dec 1992 07:50:13 -0500
- From: els@sirius.hrb.com (Eric L. Schott)
- Subject: RE: x-set-point-and-insert-selection
- Message-ID: <9212171250.AA16434@sirius.hrb.com>
- Content-Transfer-Encoding: 7BIT
- References: <RJC.92Dec16180057@daiches.cogsci.ed.ac.uk>
- Newsgroups: alt.lucid-emacs.bug
- Path: sparky!uunet!wendy-fate.uu.net!bug-lucid-emacs
- Sender: bug-lucid-emacs-request@lucid.com
- Lines: 77
-
- Richard Caley writes:
- >
- > This seems to be broken in 19.3. I have it bound to the middle mouse
- > button.
- >
- > What happens is that I select some text, then try and paste it using
- > the middle button somewhere else in the same buffer and the text
- > between the selection and the insertion point is insterted too.
- >
- > I think that that x-set-point-and-insert-selection is setting the
- > point before looking at the selection and the set-point it is using is
- > one which extends the selection.
-
- Jamie mailed a fix to this to me. The patch is below.
-
- *** x-mouse.el.dist Fri Sep 4 05:43:01 1992
- --- x-mouse.el Fri Sep 18 07:52:54 1992
- ***************
- *** 32,59 ****
- (let ((s (buffer-substring old-point (point))))
- (x-own-clipboard s)
- (x-store-cutbuffer s))
- (kill-region old-point (point))))
-
- ! (defun x-insert-selection (&optional check-cutbuffer-p)
- "Insert the current selection into buffer at point."
- (interactive)
- (let ((text (if check-cutbuffer-p
- (or (condition-case () (x-get-selection) (error ()))
- (x-get-cutbuffer)
- (error "No selection or cut buffer available"))
- (x-get-selection))))
- (push-mark (point))
- (insert text)
- ;; (if zmacs-regions (zmacs-activate-region))
- ))
-
- (defun x-set-point-and-insert-selection (event)
- "Sets point where clicked and insert the primary selection or the cut buffer"
- (interactive "e")
- ! (mouse-set-point event)
- ! (x-insert-selection t))
-
- (defun mouse-track-and-copy-to-cutbuffer (event)
- "Makes a selection like `mouse-track', but also copies it to the cutbuffer."
- (interactive "e")
- (mouse-track event)
- --- 32,59 ----
- (let ((s (buffer-substring old-point (point))))
- (x-own-clipboard s)
- (x-store-cutbuffer s))
- (kill-region old-point (point))))
-
- ! (defun x-insert-selection (&optional check-cutbuffer-p move-point-p)
- "Insert the current selection into buffer at point."
- (interactive)
- (let ((text (if check-cutbuffer-p
- (or (condition-case () (x-get-selection) (error ()))
- (x-get-cutbuffer)
- (error "No selection or cut buffer available"))
- (x-get-selection))))
- + (if move-point-p (mouse-set-point event))
- (push-mark (point))
- (insert text)
- ;; (if zmacs-regions (zmacs-activate-region))
- ))
-
- (defun x-set-point-and-insert-selection (event)
- "Sets point where clicked and insert the primary selection or the cut buffer"
- (interactive "e")
- ! (x-insert-selection t t))
-
- (defun mouse-track-and-copy-to-cutbuffer (event)
- "Makes a selection like `mouse-track', but also copies it to the cutbuffer."
- (interactive "e")
- (mouse-track event)
-
-