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 >
Wrap
Text File
|
1989-01-11
|
7KB
|
322 lines
Mike Montague's preferences (This is out of date and may no longer work,
but you can get some good ideas from it)
Name:Ufilename
Mouse Menus and a Directory Editor for Freemacs.
The mouse menu is shown when the right button on the mouse is pressed.
While still holding the right button down the left button is used to
select a menu item. The menu items include:
Select-Buffer One-Window Dir-Editor Fill-Mode
Save-Buffer Two-Windows Shell-Escape Indent-Mode
Not-Modified Other-Window Shell-Buffer Spell-Mode
It would be very simple to change the menu. The menus are consistent in
that the right button brings up the menu and the left button selects. If the
right button is released, the menu will disappear.
The directory editor works by displaying the current directory in a
buffer with each file or sub-directory listed on a seperate line. An
entry is selected by moving the cursor to the item you want and holding
down the left mouse button; then press the right mouse button. If the item
is a file it is loaded; if the item is a directory then the current directory
is changed to that directory. A file can be deleted using C-k. To prevent
unwanted loss of files, the user is prompted as to whether they actually
want to delete the file. Sometime in the future I want to add the
functions to do multiple deletes and that sort of thing.
There is also a function which makes nice comments; it is bound to
C-Return. I also added some stuff to Freadline (this is the group of
functions which take care of reading from the mini-buffer below the mode
line) so that pushing the left mouse button is the same as pressing
return, and so that pressing the other mouse buttons doesn't beep at you
any more.
Michael Montague
Clarkson University
mkm@clutx.clarkson.edu
[*]user[*]
Name:U&setup
[*][*]
Name:U-comment-column
Amount of space between the comments.
[*]64[*]
Name:U-left-comment
[*]/*[*]
Name:U-right-comment
[*]*/[*]
Name:U:buffer-save
Save a buffer which is selected using the mouse.
[*]
#(ds,original-buffer,#(ba,-1))
#(sv,bc,##(Umouse-menu-color))
#(Ffor-all-buffers,Flist-buffers-do)
#(g)
#(ds,value,#(g))
#(==,##(value),Right Up,,(
#(==,##(value),Left Down,(
##(ba,#(Umouse-select-buffer,#(pp)))
#(sv,bc,0)
#(F:write-current-file)
##(ba,##(original-buffer))))))
#(sv,bc,0)
#(rd)
[*]
Name:U:dired
Sets up the DIR buffer with the current directory listed in it.
[*]
#(Ffind-or-make-buffer,DIR,,)
#(Fenter-minor-mode,Dired)
#(sp,[)
#(dm,])
#(Fmultiple,Edired-list,##(ff,*.*,(,)))
[*]
Name:U:mouse-buffer
Select a buffer using the mouse.
[*]
#(sv,bc,##(Umouse-menu-color))
#(xy,0,##(--,##(lv,tl),1))
#(Ffor-all-buffers,Flist-buffers-do)
#(xy,0,0)
#(g)
#(ds,value,#(g))
#(==,##(value),Right Up,,(
#(==,##(value),Left Down,(
##(ba,#(Umouse-select-buffer,#(pp)))))))
#(sv,bc,0)
#(rd)
[*]
Name:U:kill-line-or-file
If in Dired mode delete the file if it is a file, otherwise
F:kill-to-end-of-line.
[*]
#(Fin-minor-mode,Dired,(
#(sp,^)
#(ds,temp,#(rm,$))
#(Fyes-or-no,Delete #(temp) ((y/n))?,(
#(de,#(rm,$))
#(sp,[)
#(dm,])
#(Fmultiple,Edired-list,##(ff,*.*,(,)))))),(
#(F:kill-to-end-of-line)))
[*]
Name:U:mouse-left
Function for mouse left button. This is necessary for the dired buffer.
[*]
#(Fin-minor-mode,Dired,(
#(==,#(Ustaydown),Right Down,(
#(U:mouse-load-file)))),(
#(F:staydown)))
[*]
Name:U:mouse-load-file
[*]
#(pm,1)
#(sp,$<)
#(sm,0,.)
#(==,#(rm,$),\,(
#(sp,^)
#(ds,value,##(rm,0))
#(ex,#(env.COMSPEC),#(env.SWITCHAR)C cd ##(value))
#(sp,[)
#(dm,])
#(Fmultiple,Edired-list,##(ff,*.*,(,)))
#(sp,[)),(
#(sp,^)
#(F:find-file,#(rm,$))))
#(pm)
[*]
Name:U:mouse-menu
[*]
#(sv,bc,##(Umouse-menu-color))
#(xy,0,##(--,##(lv,tl),1))
#(ow,
Select-Buffer One-Window Dir-Editor Fill-Mode(
)Save-Buffer Two-Windows Shell-Escape Indent-Mode(
)Not-Modified Other-Window Shell-Buffer Spell-Mode())
#(xy,0p,0)
#(ds,value,#(g))
#(==,##(value),Right Up,,(
#(==,##(value),Left Down,(
#(sv,bc,0)
#(rd)
#(Umouse-menu-do,#(Umouse-select,#(pp)))))))
#(sv,bc,0)
#(rd)
[*]
Name:U:mouse-right
Function for mouse right button. This is necessary for the dired buffer.
[*]
#(Finp-minor-mode,Dired,(
#(U:mouse-load-file)),(
#(U:mouse-menu)))
[*]
Name:Uadd-delimeters
[*]
#(Fwhitespace,,(
#(is,##(U-left-comment) )
#(Uadd-right-comment-do)
#(sp,>)
#(SELF)))
[*]
Name:Uadd-right-comment-do
[*]#(ds,temp,##(++,##(U-comment-column),6))
#(sv,cs,##(temp))
#(==,#(lv,cs),##(temp),(
#(is,##(U-right-comment))),(
#(is, )
#(SELF)))
[*]
Name:Ubuffer-not-modified
[*]
#(ds,original-buffer,#(ba,-1))
#(sv,bc,##(Umouse-menu-color))
#(Ffor-all-buffers,Flist-buffers-do)
#(g)
#(ds,value,#(g))
#(==,##(value),Right Up,,(
#(==,##(value),Left Down,(
##(ba,#(Umouse-select-buffer,#(pp)))
#(sv,bc,0)
#(F:buffer-not-modified)
##(ba,##(original-buffer))))))
#(sv,bc,0)
#(rd)
[*]
Name:Udired-list
Lists each file name into the DIR buffer on a seperate line.
[*]
#(is,arg1)
#(Fcrlf)
[*]
Name:Umake
[*]#(F:write-modified-files)
#(Ffind-or-make-buffer,MAKE)
#(ef,#(Fsearch-path,make),,.)
#(ds,error-buffer,##(ba,-1))
#(sv,ow,##(ba,-1))
#(sp,[)
#(Fmode-line)
#(..,##(ba,##(old-buffer)))
[*]
Name:Umenu-size
[*]3[*]
Name:Umouse-menu-color
[*]4[*]
Name:Umouse-menu-do
[*]
#(g?,arg1,6,(
#(Fcase,arg1,
(7,(#(U:dired))),
(8,(#(F:suspend-emacs))),
(9,(#(F:shell-command-to-buffer))),
(10,(#(F:auto-fill-mode))),
(11,(#(F:auto-indent-mode))),
(12,(#(F:auto-spell-mode))),
(0,()))),(
#(Fcase,arg1,
(1,(#(U:mouse-buffer))),
(2,(#(U:buffer-save))),
(3,(#(Ubuffer-not-modified))),
(4,(#(F:one-window))),
(5,(#(F:two-windows))),
(6,(#(F:other-window))),
(0,()))))
[*]
Name:Umouse-select
[*]
##(++,
##(**,##(//,arg1,20),##(Umenu-size)),
##(++,##(--,##(--,arg2,##(--,##(lv,cl),##(lv,rs))),
##(lv,tl)),1))
[*]
Name:Umouse-select-buffer
[*]
##(++,##(--,##(--,arg2,##(--,##(lv,cl),##(lv,rs))),
##(lv,tl)),2))
[*]
Name:Ustaydown
Keep repositioning the cursor to match the mouse position.
[*]
#(ds,temp,##(it,0))
#(==,##(temp),Timeout,(
#(rd)
#(Fgoto-row-and-column,#(pp))
#(SELF)
),(
##(temp)))
[*]
Name:U:comment-line
Makes the current line into a comment.
[*]
#(sp,^)
##(is,##(U-left-comment) )
#(sp,$)
#(Fpad-to-column,##(U-comment-column))
#(is, ##(U-right-comment))
#(Fcrlf)
[*]
Name:K.C-k
[*]U:kill-line-or-file[*]
Name:K.C-Return
[*]U:comment-line[*]
Name:K.Left Down
[*]U:mouse-left[*]
Name:K.Right Down
[*]U:mouse-menu[*]
Name:Freadline.Left Down
[*]#(an)arg1[*]
Name:Freadline.Left Up
[*]again[*]
Name:Freadline.Right Down
[*]again[*]
Name:Freadline.Right Up
[*]again[*]