home *** CD-ROM | disk | FTP | other *** search
/ Mega CD-ROM 1 / megacd_rom_1.zip / megacd_rom_1 / FREEMACS / CONTRIB.ZIP / MMOUSE.MIN < prev    next >
Text File  |  1989-01-11  |  7KB  |  322 lines

  1. Mike Montague's preferences (This is out of date and may no longer work,
  2. but you can get some good ideas from it)
  3.  
  4.  
  5. Name:Ufilename
  6.  
  7. Mouse Menus and a Directory Editor for Freemacs.
  8.  
  9. The mouse menu is shown when the right button on the mouse is pressed.
  10. While still holding the right button down the left button is used to
  11. select a menu item.  The menu items include:
  12. Select-Buffer      One-Window          Dir-Editor          Fill-Mode
  13. Save-Buffer        Two-Windows         Shell-Escape        Indent-Mode
  14. Not-Modified       Other-Window        Shell-Buffer        Spell-Mode
  15.  
  16. It would be very simple to change the menu.  The menus are consistent in
  17. that the right button brings up the menu and the left button selects.  If the
  18. right button is released, the menu will disappear.
  19.  
  20. The directory editor works by displaying the current directory in a
  21. buffer with each file or sub-directory listed on a seperate line.  An
  22. entry is selected by moving the cursor to the item you want and holding
  23. down the left mouse button; then press the right mouse button.  If the item
  24. is a file it is loaded; if the item is a directory then the current directory
  25. is changed to that directory.  A file can be deleted using C-k.  To prevent
  26. unwanted loss of files, the user is prompted as to whether they actually
  27. want to delete the file.  Sometime in the future I want to add the
  28. functions to do multiple deletes and that sort of thing.
  29.  
  30. There is also a function which makes nice comments; it is bound to
  31. C-Return.  I also added some stuff to Freadline (this is the group of
  32. functions which take care of reading from the mini-buffer below the mode
  33. line) so that pushing the left mouse button is the same as pressing
  34. return, and so that pressing the other mouse buttons doesn't beep at you
  35. any more.
  36.  
  37. Michael Montague
  38. Clarkson University
  39. mkm@clutx.clarkson.edu
  40. [*]user[*]
  41.  
  42.  
  43. Name:U&setup
  44. [*][*]
  45.  
  46. Name:U-comment-column
  47. Amount of space between the comments.
  48. [*]64[*]
  49.  
  50. Name:U-left-comment
  51. [*]/*[*]
  52.  
  53. Name:U-right-comment
  54. [*]*/[*]
  55.  
  56. Name:U:buffer-save
  57. Save a buffer which is selected using the mouse.
  58. [*]
  59. #(ds,original-buffer,#(ba,-1))
  60. #(sv,bc,##(Umouse-menu-color))
  61. #(Ffor-all-buffers,Flist-buffers-do)
  62. #(g)
  63. #(ds,value,#(g))
  64. #(==,##(value),Right Up,,(
  65.     #(==,##(value),Left Down,(
  66.         ##(ba,#(Umouse-select-buffer,#(pp)))
  67.         #(sv,bc,0)
  68.         #(F:write-current-file)
  69.         ##(ba,##(original-buffer))))))
  70. #(sv,bc,0)
  71. #(rd)
  72. [*]
  73.  
  74.  
  75. Name:U:dired
  76. Sets up the DIR buffer with the current directory listed in it.
  77. [*]
  78. #(Ffind-or-make-buffer,DIR,,)
  79. #(Fenter-minor-mode,Dired)
  80. #(sp,[)
  81. #(dm,])
  82. #(Fmultiple,Edired-list,##(ff,*.*,(,)))
  83. [*]
  84.  
  85. Name:U:mouse-buffer
  86. Select a buffer using the mouse.
  87. [*]
  88. #(sv,bc,##(Umouse-menu-color))
  89. #(xy,0,##(--,##(lv,tl),1))
  90. #(Ffor-all-buffers,Flist-buffers-do)
  91. #(xy,0,0)
  92. #(g)
  93. #(ds,value,#(g))
  94. #(==,##(value),Right Up,,(
  95.     #(==,##(value),Left Down,(
  96.         ##(ba,#(Umouse-select-buffer,#(pp)))))))
  97. #(sv,bc,0)
  98. #(rd)
  99. [*]
  100.  
  101. Name:U:kill-line-or-file
  102. If in Dired mode delete the file if it is a file, otherwise
  103. F:kill-to-end-of-line.
  104. [*]
  105. #(Fin-minor-mode,Dired,(
  106.     #(sp,^)
  107.     #(ds,temp,#(rm,$))
  108.     #(Fyes-or-no,Delete #(temp) ((y/n))?,(
  109.         #(de,#(rm,$))
  110.         #(sp,[)
  111.         #(dm,])
  112.         #(Fmultiple,Edired-list,##(ff,*.*,(,)))))),(
  113.     #(F:kill-to-end-of-line)))
  114. [*]
  115.  
  116. Name:U:mouse-left
  117. Function for mouse left button.  This is necessary for the dired buffer.
  118. [*]
  119. #(Fin-minor-mode,Dired,(
  120.     #(==,#(Ustaydown),Right Down,(
  121.         #(U:mouse-load-file)))),(
  122.     #(F:staydown)))
  123. [*]
  124.  
  125.  
  126. Name:U:mouse-load-file
  127. [*]
  128. #(pm,1)
  129. #(sp,$<)
  130. #(sm,0,.)
  131. #(==,#(rm,$),\,(
  132.     #(sp,^)
  133.     #(ds,value,##(rm,0))
  134.     #(ex,#(env.COMSPEC),#(env.SWITCHAR)C cd ##(value))
  135.     #(sp,[)
  136.     #(dm,])
  137.     #(Fmultiple,Edired-list,##(ff,*.*,(,)))
  138.     #(sp,[)),(
  139.     #(sp,^)
  140.     #(F:find-file,#(rm,$))))
  141. #(pm)
  142. [*]
  143.  
  144.  
  145. Name:U:mouse-menu
  146. [*]
  147. #(sv,bc,##(Umouse-menu-color))
  148. #(xy,0,##(--,##(lv,tl),1))
  149. #(ow,
  150. Select-Buffer      One-Window           Dir-Editor          Fill-Mode(
  151. )Save-Buffer        Two-Windows         Shell-Escape        Indent-Mode(
  152. )Not-Modified       Other-Window        Shell-Buffer        Spell-Mode())
  153. #(xy,0p,0)
  154. #(ds,value,#(g))
  155. #(==,##(value),Right Up,,(
  156.     #(==,##(value),Left Down,(
  157.         #(sv,bc,0)
  158.         #(rd)
  159.         #(Umouse-menu-do,#(Umouse-select,#(pp)))))))
  160. #(sv,bc,0)
  161. #(rd)
  162. [*]
  163.  
  164.  
  165. Name:U:mouse-right
  166. Function for mouse right button.  This is necessary for the dired buffer.
  167. [*]
  168. #(Finp-minor-mode,Dired,(
  169.     #(U:mouse-load-file)),(
  170.     #(U:mouse-menu)))
  171. [*]
  172.  
  173.  
  174. Name:Uadd-delimeters
  175. [*]
  176. #(Fwhitespace,,(
  177.     #(is,##(U-left-comment) )
  178.     #(Uadd-right-comment-do)
  179.     #(sp,>)
  180.     #(SELF)))
  181. [*]
  182.  
  183.  
  184. Name:Uadd-right-comment-do
  185. [*]#(ds,temp,##(++,##(U-comment-column),6))
  186. #(sv,cs,##(temp))
  187. #(==,#(lv,cs),##(temp),(
  188.     #(is,##(U-right-comment))),(
  189.     #(is, )
  190.     #(SELF)))
  191. [*]
  192.  
  193.  
  194. Name:Ubuffer-not-modified
  195. [*]
  196. #(ds,original-buffer,#(ba,-1))
  197. #(sv,bc,##(Umouse-menu-color))
  198. #(Ffor-all-buffers,Flist-buffers-do)
  199. #(g)
  200. #(ds,value,#(g))
  201. #(==,##(value),Right Up,,(
  202.     #(==,##(value),Left Down,(
  203.         ##(ba,#(Umouse-select-buffer,#(pp)))
  204.         #(sv,bc,0)
  205.         #(F:buffer-not-modified)
  206.         ##(ba,##(original-buffer))))))
  207. #(sv,bc,0)
  208. #(rd)
  209. [*]
  210.  
  211. Name:Udired-list
  212. Lists each file name into the DIR buffer on a seperate line.
  213. [*]
  214. #(is,arg1)
  215. #(Fcrlf)
  216. [*]
  217.  
  218. Name:Umake
  219. [*]#(F:write-modified-files)
  220. #(Ffind-or-make-buffer,MAKE)
  221. #(ef,#(Fsearch-path,make),,.)
  222. #(ds,error-buffer,##(ba,-1))
  223. #(sv,ow,##(ba,-1))
  224. #(sp,[)
  225. #(Fmode-line)
  226. #(..,##(ba,##(old-buffer)))
  227. [*]
  228.  
  229.  
  230. Name:Umenu-size
  231. [*]3[*]
  232.  
  233.  
  234. Name:Umouse-menu-color
  235. [*]4[*]
  236.  
  237.  
  238. Name:Umouse-menu-do
  239. [*]
  240. #(g?,arg1,6,(
  241. #(Fcase,arg1,
  242.     (7,(#(U:dired))),
  243.     (8,(#(F:suspend-emacs))),
  244.     (9,(#(F:shell-command-to-buffer))),
  245.     (10,(#(F:auto-fill-mode))),
  246.     (11,(#(F:auto-indent-mode))),
  247.     (12,(#(F:auto-spell-mode))),
  248.     (0,()))),(
  249. #(Fcase,arg1,
  250.     (1,(#(U:mouse-buffer))),
  251.     (2,(#(U:buffer-save))),
  252.     (3,(#(Ubuffer-not-modified))),
  253.     (4,(#(F:one-window))),
  254.     (5,(#(F:two-windows))),
  255.     (6,(#(F:other-window))),
  256.     (0,()))))
  257. [*]
  258.  
  259.  
  260. Name:Umouse-select
  261. [*]
  262. ##(++,
  263.     ##(**,##(//,arg1,20),##(Umenu-size)),
  264.     ##(++,##(--,##(--,arg2,##(--,##(lv,cl),##(lv,rs))),
  265.         ##(lv,tl)),1))
  266. [*]
  267.  
  268.  
  269. Name:Umouse-select-buffer
  270. [*]
  271. ##(++,##(--,##(--,arg2,##(--,##(lv,cl),##(lv,rs))),
  272.     ##(lv,tl)),2))
  273. [*]
  274.  
  275.  
  276. Name:Ustaydown
  277. Keep repositioning the cursor to match the mouse position.
  278. [*]
  279. #(ds,temp,##(it,0))
  280. #(==,##(temp),Timeout,(
  281.     #(rd)
  282.     #(Fgoto-row-and-column,#(pp))
  283.     #(SELF)
  284. ),(
  285.     ##(temp)))
  286. [*]
  287.  
  288. Name:U:comment-line
  289. Makes the current line into a comment.
  290. [*]
  291. #(sp,^)
  292. ##(is,##(U-left-comment) )
  293. #(sp,$)
  294. #(Fpad-to-column,##(U-comment-column))
  295. #(is, ##(U-right-comment))
  296. #(Fcrlf)
  297. [*]
  298.  
  299. Name:K.C-k
  300. [*]U:kill-line-or-file[*]
  301.  
  302. Name:K.C-Return
  303. [*]U:comment-line[*]
  304.  
  305. Name:K.Left Down
  306. [*]U:mouse-left[*]
  307.  
  308. Name:K.Right Down
  309. [*]U:mouse-menu[*]
  310.  
  311. Name:Freadline.Left Down
  312. [*]#(an)arg1[*]
  313.  
  314. Name:Freadline.Left Up
  315. [*]again[*]
  316.  
  317. Name:Freadline.Right Down
  318. [*]again[*]
  319.  
  320. Name:Freadline.Right Up
  321. [*]again[*]
  322.