;;;* Last edited: Jul 19 21:46 1995 (sw)

;;; This implements some mouse functionality that was inspired 
;;; by the "sun-mouse" bindings from when an emacs ran on
;;; a vax displaying on an early sun, which was used as 
;;; a network terminal.  


(global-set-key [M-mouse-1] 'mouse-adjust-down)
(global-set-key [M-mouse-3] 'mouse-adjust-up)

(defun event-y (event) (cdr (third (cadr event))))

(defun mouse-adjust-up (event)
  "scroll the window the mouse hit so that the line that
was hit is at the top of the screen (if possible)"
  (interactive "@e")
  (scroll-up (event-y event)))

(defun mouse-adjust-down (event)
  "scroll the window the mouse hit so that the line that
was hit is at the bottom of the screen (if possible)"
  (interactive "@e")
  (scroll-up (- (event-y event) (window-height) -2)))
;1
;2
;3
;4
;5
;6
;7
;8
;9
;10
;11
;12
;13
;14
;15
;16
;17
;18
;19
;20
;21
;22
;23
;24
;25
;26
;27
;28
;29
;30
;31
;32
;33
;34
;35
;36
;37
;38
;39
;40
;41
;42
;43
;44
;45
;46
;47
;48
;49
;50
