home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / alt / lucidem / help / 418 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.4 KB  |  40 lines

  1. x-gateway: rodan.UU.NET from help-lucid-emacs to alt.lucid-emacs.help; Sat, 12 Sep 1992 03:21:48 EDT
  2. Message-ID: <9209120721.AA05272@ntu.ac.sg>
  3. Sender: franks%ntu.ac.sg@lucid.com
  4. Date: Sat, 12 Sep 1992 15:22:20 +0730
  5. From: franks%ntu.ac.sg@lucid.com (Frank Siebenlist)
  6. Subject: mouse scrolling for lemacs 19
  7. Newsgroups: alt.lucid-emacs.help
  8. Path: sparky!uunet!wendy-fate.uu.net!help-lucid-emacs
  9. Lines: 29
  10.  
  11. The following few lines may make your lifes a little easier
  12. (until we get our scrollbars....),
  13. unless you're using hyperbole 
  14. (in which case the interesting parts keep jumping of your screen...).
  15.  
  16. Enjoy, Frank.
  17.  
  18. -------------------------cut-here-------------------------------------------
  19. -
  20. ;; mouse-scroll-prop.el
  21. ;; proportional mouse scrolling for lemacs-19
  22. ;;
  23. ;; add next three lines to .emacs and modify key assignment to taste:
  24. ;;(load "mouse-scroll-prop")
  25. ;;(define-key global-map '(control button2) 'mouse-scroll-up-prop)
  26. ;;(define-key global-map '(control button3) 'mouse-scroll-down-prop)
  27.  
  28. (defun mouse-scroll-up-prop (event)
  29.   "Scrolls window up proportionally, i.e. clicked line becomes first line."
  30.   (interactive "@event")
  31.   (scroll-up (- (event-y event) (car (cdr (window-edges))))))
  32.  
  33. (defun mouse-scroll-down-prop (event)
  34.   "Scrolls window down proportionally, i.e. clicked line becomes last
  35. line."
  36.   (interactive "@event")
  37.   (scroll-down (- (car (cdr (cdr (cdr (window-edges))))) (event-y event)
  38. 2)))
  39.  
  40.