From:	CRDGW2::CRDGW2::MRGATE::"SMTP::PREP.AI.MIT.EDU::GNU-EMACS-SOURCES-REQUEST" 19-MAR-1991 20:04:04.55
To:	ARISIA::EVERHART
CC:	
Subj:	Some silly mouse functions for Sunview Emacstool

From:	gnu-emacs-sources-request@prep.ai.mit.edu@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.91)
	 id AA13035; Tue, 19 Mar 91 19:53:34 EST
Received: by life.ai.mit.edu (4.1/AI-4.10) id AA05762; Tue, 19 Mar 91 18:37:25 EST
Return-Path: <gnu-emacs-sources-request@prep.ai.mit.edu>
Received: from tut.cis.ohio-state.edu by life.ai.mit.edu (4.1/AI-4.10) id AA05730; Tue, 19 Mar 91 18:36:35 EST
Received: by tut.cis.ohio-state.edu (5.61-kk/5.910301)
	id AA14418; Tue, 19 Mar 91 18:32:30 -0500
Received: from USENET by tut.cis.ohio-state.edu with netnews
	for gnu-emacs-sources@prep.ai.mit.edu (gnu-emacs-sources@prep.ai.mit.edu)
	(contact usenet@tut.cis.ohio-state.edu if you have questions)
Date: 19 Mar 91 22:26:55 GMT
From: samsung!know!tegra!vail@zaphod.mps.ohio-state.edu  (Johnathan Vail)
Organization: Tegra-Varityper, Inc., Billerica, MA
Subject: Some silly mouse functions for Sunview Emacstool
Message-Id: <2181@atlas.tegra.COM>
Sender: gnu-emacs-sources-request@prep.ai.mit.edu
To: gnu-emacs-sources@prep.ai.mit.edu


Here are some mildly useful functions for use with the Sunview
emacstool.

have fun, jv

;;;
;;;	jvmouse.el
;;;
;;;	Some random functions for use with the mouse
;;;
;;;	Written by Johnathan Vail at Tegra Varityper
;;;		vail@tegra.com
;;;
;;;	 1 Jun 1990 JV	- Require...
;;;	14 May 1990 JV	- Created
;;;

(require 'sun-mouse)
(require 'tags)


(global-set-mouse '(text      right middle )	'mouse-find-tag-other-window)
(global-set-mouse '(text meta right middle )	'mouse-find-next-tag-other-window)
(global-set-mouse '(text left middle       )	'mouse-kill-point-to-mouse)

(defun mouse-find-tag-other-window (window x y)
  "Find TAG that mouse points to and display in other window"

  (save-excursion
    (eval-in-window window	;; use this to get the unwind protect
		  (move-to-loc x y)
		  (find-tag (find-tag-default) nil t))))


(defun mouse-find-next-tag-other-window (window x y)
  "Find next TAG that mouse points to and display in other window"

  (save-excursion
    (eval-in-window window	;; use this to get the unwind protect
		  (move-to-loc x y)
		  (find-tag (find-tag-default) t t))))


(defun mouse-kill-point-to-mouse (window x y)
  "Kill the region from point to mouse"

  (let ((start (point)))
    (eval-in-window window
		    (move-to-loc x y)
		    (kill-region start (point)))))
