home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / packages / MouseAndMenuEmacs / ebuff-menus.el < prev    next >
Encoding:
Text File  |  1990-05-31  |  1.9 KB  |  47 lines

  1. ;;;; X Emacs functions and menus for electric buffer mode.
  2. ;;;; Allow mark and shoot with middle and left buttons, menu on right.
  3. ;;;; Russell Ritchie, Scottish HCI Centre, <russell@uk.ac.strath.hci>.
  4. ;;;; Fri May 11 12:10:05 1990 
  5.  
  6. (require 'x-menus)
  7. (provide 'ebuff-menus)
  8.  
  9. (defXmenu 'electric-buffer-menu
  10.   '("Electric Buffer Menu"
  11.     ("Buffer Menu"
  12.      ("Mark buffer on cursor line to be shown" x-mouse-ebuff-select)
  13.      ("Mark buffer on cursor line to be saved" x-mouse-ebuff-save)
  14.      ("Mark buffer on cursor line to be killed" x-mouse-ebuff-kill)
  15.      ("Show (and save or kill) marked buffers" x-mouse-ebuff-exit)
  16.      ("View buffer on line cursor is on" x-mouse-ebuff-view)
  17.      ("Quit, restoring previous window configuration"  x-mouse-ebuff-quit))))
  18.  
  19. (defun x-mouse-ebuff-show (arg)
  20.   "Exit Electric Buffer mode and show the buffer under the mouse."
  21.   (eval-in-window x-mouse-window
  22.     (x-mouse-move-point arg)
  23.     (Electric-buffer-menu-select)))
  24.  
  25. (defun x-mouse-ebuff-select ()
  26.   "Mark the buffer on cursor line to be shown when Electric Buffer Mode exits."
  27.   (eval-in-window x-mouse-window (Buffer-menu-mark)))
  28.  
  29. (defun x-mouse-ebuff-save ()
  30.   "Mark the buffer on cursor line to be saved when Electric Buffer Mode exits."
  31.   (eval-in-window x-mouse-window (Buffer-menu-save)))
  32.  
  33. (defun x-mouse-ebuff-kill ()
  34.   "Mark the buffer on cursor line to be killed when Electric Buffer Mode exits."
  35.   (eval-in-window x-mouse-window (Buffer-menu-delete)))
  36.  
  37. (defun x-mouse-ebuff-exit ()
  38.   "Exit Electric Buffer Mode saving, killing and showing buffers as marked."
  39.   (eval-in-window x-mouse-window (Electric-buffer-menu-exit)))
  40.  
  41. (defun x-mouse-ebuff-view ()
  42.   "View the buffer on the line the cursor is on."
  43.   (eval-in-window x-mouse-window (Electric-buffer-menu-mode-view-buffer)))
  44.  
  45. (defun x-mouse-ebuff-quit ()
  46.  "Quit from Electric Buffer Mode, restoring previous window configuration."
  47.  (eval-in-window x-mouse-window (Electric-buffer-menu-quit)))