home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / alt / lucidem / help / 338 < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.1 KB  |  52 lines

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!darwin.sura.net!zaphod.mps.ohio-state.edu!rphroy!kocrsv01!c23mts
  2. From: c23mts@kocrsv01.delcoelect.com (Mike Scheidler)
  3. Newsgroups: alt.lucid-emacs.help
  4. Subject: Mouse enhancements for buffer-menu mode
  5. Message-ID: <1992Aug26.165853.22947@kocrsv01.delcoelect.com>
  6. Date: 26 Aug 92 16:58:53 GMT
  7. Sender: news@kocrsv01.delcoelect.com (Usenet News Account)
  8. Reply-To: c23mts@kocrsv01.delcoelect.com
  9. Organization: Delco Electronics Corp.
  10. Lines: 39
  11. Originator: c23mts@kocrsw12
  12.  
  13.  
  14. Here are a couple of mouse-based functions I use with buffer menu mode.
  15. They're not elegant or complicated, but they make my life a little easier.
  16.  
  17. I have these new functions mapped to buttons 2 and 3, keeping the default
  18. mapping for button 1.  This lets me switch to the buffer menu window with a
  19. click of button 1 whenever I want to do other buffer menu operations.
  20.  
  21. Clicking button 2 on a buffer menu line will switch to that buffer, closing
  22. all other windows on that screen.  (This is just like pressing '1' on the
  23. line).  Clicking button 3 in a similar manner will cause the selected buffer
  24. to come up in a new screen and switch focus there.
  25.  
  26.  
  27. (defun Buffer-mouse-1-window (event)
  28.   "Switch to buffer in 1 window using mouse."
  29.   (interactive "@e")
  30.   (select-window (event-window event))
  31.   (mouse-set-point event)
  32.   (switch-to-buffer (Buffer-menu-buffer t))
  33.   (bury-buffer (other-buffer))
  34.   (delete-other-windows))
  35.  
  36. (defun Buffer-mouse-new-screen (event)
  37.   "Switch to buffer in a new screen using mouse."
  38.   (interactive "@e")
  39.   (select-window (event-window event))
  40.   (mouse-set-point event)
  41.   (select-screen (new-screen))
  42.   (switch-to-buffer (Buffer-menu-buffer t)))
  43.  
  44. (define-key Buffer-menu-mode-map 'button2 'Buffer-mouse-1-window)
  45. (define-key Buffer-menu-mode-map 'button3 'Buffer-mouse-new-screen)
  46.  
  47. -- 
  48.  Mike Scheidler                    INTERNET:  c23mts@kocrsv01.delcoelect.com
  49.  Software Technology               UUCP:      deaes!c23mts
  50.  Delco Electronics Corporation     PHONE:     (317) 451-0642
  51.  Kokomo, IN 46904                  GMNET:     8-322-0642
  52.