[comp.emacs] Freemacs 1.5d patches

nelson@SUN.SOE.CLARKSON.EDU (Russ Nelson) (02/13/89)

This is a patch file for Freemacs 1.5d.  Download it to your pc and
call it patch1.min, load it into Freemacs, and press F2 on the next line:
#(ds,old-search,<TAB>)#(ds,old-replace,##(bc,9,d,a))#(sp,$>)#(F:try-it)
#(Freplace-with,!)#(M:done-editing)#(F:save-all-libs)

This will change <TAB> into a single tab character, run M-x done-editing,
(which will make the patches), and then M-x save-all-libs (which will
write the patches to disk).  If you have changed your copy of Freemacs
1.5d then you should examine the patches.  Otherwise you should have
no problems.

Reading this file will tell you what bugs have been fixed.
-russ


Name:Frevlevel
We're current to patch level one.
[*]1[*]


Didn't capitalize already-capitalized words properly.

Name:F:capitalize-word
Capitalize the word after point.
[*]#(sp,+)
#(Fxlat-region,>,Fxlat-upper)
#(Fxlat-region,},Fxlat-lower)
#(sp,})
[*]

Didn't work right if the mark in arg1 wasn't a user mark.

Name:Fxlat-region
Translate the region according to the mark in arg1, and the string in arg2.
[*]#(pm,1)
#(sm,0,arg1)
#(==,#(mb,0,no,yes),yes,
<TAB>#(ds,temp,##(si,arg2,##(rm,0)))
<TAB>#(==,##(temp),,,(
<TAB><TAB>#(dm,0)
<TAB><TAB>#(is,##(go,temp))
<TAB><TAB>#(sm,0,<)
<TAB><TAB>#(is,##(gs,temp))
<TAB>))
<TAB>(
<TAB><TAB>#(pm,1)
<TAB><TAB>#(sp,0)
<TAB><TAB>#(sm,arg1,0)
<TAB><TAB>#(pm)
<TAB>)
))
#(pm)[*]


If you type C-q C-m in readline mode, you get CRLF where you used to get CR.


Name:Freadline.C-q
Get a control character and insert it.
[*]#(ds,temp,#(Fquoted-char))
#(==,##(temp),##(bc,13,d,a),(
<TAB>#(==,arg2,,,(#(ds,value)))
<TAB>#(ds,value,
<TAB><TAB>##(value)
<TAB><TAB>##(bc,13,d,a)
<TAB><TAB>##(bc,10,d,a)
<TAB>)
<TAB>again
),(
<TAB>#(Freadline.other,(##(temp)),arg2)
))[*]

Add "Return" to the list of recognized keys.

Name:Fquoted-char
Prompt the user for a control character, and return the character.
[*]#(an,Enter control character (\ for octal) ?)
#(ds,temp,#(g))
#(an)
#(==,##(gn,temp,1),\,(
<TAB>#(ds,value)
<TAB>#(Freadline,Octal code:,foo)
<TAB>#(bc,#(value),o,a)
),(
#(rs,temp)
#(==,##(gn,temp,2),C-,(
<TAB>##(bc,##(--,#(Ftoupper,##(bc,##(gs,temp),a,d)),64),d,a)
),(
<TAB>#(rs,temp)
<TAB>#(Fcase,##(temp),
<TAB><TAB>(Return,(##(bc,13,d,a))),
<TAB><TAB>(LPar,(##(bc,40,d,a))),
<TAB><TAB>(RPar,(##(bc,41,d,a))),
<TAB><TAB>(Comma,((,))),
<TAB><TAB>(Tab,((<TAB>))),
<TAB><TAB>(Escape,(##(bc,29,d,a))),
<TAB><TAB>(##(temp))
<TAB>)
))))[*]


Prompts for a filename like Gnu Emacs does.


Name:F:find-file
Make a buffer current if already loaded, or else load it.
[*]#(==,arg1,,(
<TAB>#(ds,value,#(Fbuffer-has-fn,(
<TAB><TAB>#(Fonly-path,#(Fbuffer-fn))
<TAB>),(
<TAB><TAB>#(lv,cd)
<TAB>)))
<TAB>#(ds,F-delete-or-append,
<TAB><TAB>##(F-delete-or-append)
<TAB><TAB>#(ds,F-delete-or-append)
<TAB><TAB>#(Fread-filename,Find: ,(
<TAB><TAB><TAB>#(SELF,##(value))
<TAB><TAB>))
<TAB>)
),(
<TAB>#(ds,temp,#(Fff-with-paths,arg1))
<TAB>#(==,##(temp),,(
<TAB><TAB>#(Ffind-file-do,arg1)
<TAB><TAB>#(an)
<TAB>),(
<TAB><TAB>#(Fmultiple,Ffind-file-do,##(temp),SELF)
<TAB><TAB>#(an)
<TAB>))
))
[*]


Now uses the variable F-delete-or-append to decide whether to delete or
append new typein.


Name:Freadline
Read a line of text from the minibuffer.
On entry, #(value) is the default string.
arg1=prompt
arg2=string to execute if input is confirmed with return.  The users input
     is in #(value)
arg3=mode.
The mode variable lets keys be redefined in readline mode.  For example,
isearch defines ^S and ^R specially, and extended-command defines space and
escape specially.
[*]#(ds,2nd-half)
#(Freadline-an,(arg1))
#(SELF-do,#(g),(arg1),(arg2),
<TAB>#(==,arg3,,Freadline.,arg3),##(F-delete-or-append))
#(es,2nd-half)[*]


Name:F-delete-or-append
If this variable is null, then the offered value when reading a line from the
keyboard will be appended to by the first keypress.  If it is non-null, then
the first keypress will delete the offered value.
[*]b[*]

Used to leave you at the end of the buffer, which was confusing.

Name:M!keys-edit
[*]#(Fremember-buffer)
#(Ffind-or-make-buffer,*keys-edit*,n)
#(Fmultiple,Mkeys-edit-do,##(sa,#(ls,(,),K.)),SELF)
#(sp,[)[*]


ESC 5 0 - should insert 50 dashes.  It didn't.  It does now.


Name:Fargument-do
Decide if arg1 is another argument character.  If not, execute it.
The first line decides if arg1 is a number or else if it is a dash at the
beginning.
[*]#(==,#(g?,1arg1,9,yes,(#(==,arg2arg1,-,yes,no))),yes,(
<TAB>#(an,C-u arg2arg1)
<TAB>#(SELF,#(g),arg2arg1)
),(
<TAB>#(an)
<TAB>#(==,arg3,,(
<TAB><TAB>#(Fargument-execute,arg1,arg2)
<TAB>),(
<TAB><TAB>#(Fargument-execute,arg1,#(**,arg3,4))
<TAB>))
))[*]

Not needed anymore.

Name:Fargument-characters
[*]***[*]


New function.  Returns the most recently visited buffer that isn't visible.
The old algorithm didn't work properly in two-window mode.


Name:Frecall-buffer
Return the most recently visited buffer that isn't visible.
[*]#(ds,-SELF,##(last-buffer))
#(mp,-SELF,,@##(buffer-number.##(ba,-1))(,),@##(buffer-number.##(lv,ow))(,))
#(ds,-SELF,#(Ffirst,#(-SELF)))
#(..,##(go,-SELF))
##(-SELF)
#(es,-SELF)[*]


Uses the new and improved #(Frecall-buffer).

Name:F:select-buffer
Change the current buffer.
[*]#(ds,value,#(Frecall-buffer))
#(Fcompleting-readline,Buffer: ,(
<TAB>#(Fswitch-to-buffer,##(value))
),(
<TAB>#(Fmultiple,(Fdelete-n-chars,12),##(ls,(,),buffer-name.##(value)),SELF)
),-)[*]


Uses the new and improved #(Frecall-buffer).

Name:Freturn-to-buffer
[*]#(ds,value,#(Frecall-buffer))
#(Fremember-buffer)
#(g?,##(buffer-name.##(value)),0,(
<TAB>#(==,##(ba,##(buffer-name.##(value))),0,(
<TAB><TAB>#(an,No such buffer)
<TAB>))
),(
<TAB>#(Fmessage,No such buffer)
))
#(Fenter-local-modes)
[*]


New function.  Really cute.


Name:Fr
Make arg1 into a string, and substitute parameters arg2 for ARG1, arg3 for ARG2,
etc...  Obviously this is a kludge that will only work to one level, but it's
very handy.
[*]#(ds,temp,(arg1))
#(mp,temp,,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8,ARG9)
#(temp,(arg2),(arg3),(arg4),(arg5),(arg6),(arg7),(arg8),(arg9))
[*]


Similar to #(Fyes-or-no) and will probably obsolete it eventually.


Name:Fy-or-n
#(Fy-or-n,PROMPT,FUNCT) will wait for a key and execute FUNCT using #(Fr) if
that key is 'y' or 'n'.  Doesn't execute FUNCT if C-g (cancel) is pressed.
It keeps trying until a recognized key is hit.
[*]#(an,arg1)
#(Fcase,#(g)#(an),
<TAB>(y,(#(Fr,(arg2),y))),
<TAB>(n,(#(Fr,(arg2),n))),
<TAB>(C-g,()),
<TAB>(
<TAB><TAB>#(Fflush-input-buffer)
<TAB><TAB>#(SELF,(arg1),(arg2))
<TAB>)
)[*]


New version -- the old one didn't quit on C-g


Name:F:save-buffers-kill-emacs
Give the user a chance to save some buffers before killing emacs.
[*]#(ds,unsaved-buffers)
#(==,#(Ffind-a-string,modified,none),none,(
<TAB>#(Ftrash-buffer,2,##(ba,-1))
),(
<TAB>#(Fy-or-n,Editor modified - save it?,(
<TAB><TAB>#(Ftrash-buffer,2,##(ba,-1)
<TAB><TAB><TAB>#(==,ARG1,y,(
<TAB><TAB><TAB><TAB>#(F:save-all-libs)
<TAB><TAB><TAB>),(
<TAB><TAB><TAB><TAB>#(ds,unsaved-buffers,##(unsaved-buffers)n)
<TAB><TAB><TAB>))
<TAB><TAB>)
<TAB>))
))[*]


New version -- the old one didn't quit on C-g


Name:Ftrash-buffer
Gives the user a chance to save unsaved changes.  First we check to see if we
should ask the user about saving this buffer.
[*]#(==,##(ba,arg1),0,(
<TAB>#(==,##(unsaved-buffers),,(
<TAB><TAB>#(an)
<TAB><TAB>#(hl)
<TAB>),(
<TAB><TAB>#(Fyes-or-no,##(nc,##(unsaved-buffers))
<TAB><TAB><TAB> modified buffer
<TAB><TAB><TAB>#(==,##(unsaved-buffers),n, exists,s exist)
<TAB><TAB><TAB> - do you really want to quit?,(
<TAB><TAB><TAB>#(hl)
<TAB><TAB>))
<TAB><TAB>#(..,##(ba,arg2))
<TAB>))
),(
<TAB>#(==,#(Fbuffer-modified,(
<TAB><TAB>#(Fbuffer-has-fn,(
<TAB><TAB><TAB>#(ds,temp,#(Fbuffer-fn))
<TAB><TAB><TAB>#(==,##(go,temp),*,,(
<TAB><TAB><TAB><TAB>yes
<TAB><TAB><TAB>))
<TAB><TAB>))
<TAB>)),yes,(
<TAB><TAB>#(Fy-or-n,Buffer #(Fbuffer-fn) modified - save it?,(
<TAB><TAB><TAB>#(==,ARG1,y,(
<TAB><TAB><TAB><TAB>#(F:write-named-file)
<TAB><TAB><TAB><TAB>#(Fbuffer-modified,n)
<TAB><TAB><TAB><TAB>#(Ftrash-buffer,##(++,arg1,1),arg2)
<TAB><TAB><TAB>),(
<TAB><TAB><TAB><TAB>#(ds,unsaved-buffers,##(unsaved-buffers)n)
<TAB><TAB><TAB><TAB>#(Ftrash-buffer,##(++,arg1,1),arg2)
<TAB><TAB><TAB>))
<TAB><TAB>))
<TAB>),(
<TAB><TAB>#(Ftrash-buffer,##(++,arg1,1),arg2)
<TAB>))
))
[*]


New version -- the old one didn't quit on C-g


Name:Fok-to-trash-buffer
#(Fok-to-trash-buffer,FUNCTIONS) asks the user if it is ok to trash the
buffer.  If the user responds with 'y', then FUNCTIONS is executed.
[*]#(Fbuffer-modified,(
<TAB>#(Fy-or-n,Buffer has been changed - destroy it?,(
<TAB><TAB>#(==,ARG1,y,(arg1))
<TAB>))
),(
<TAB>arg1
))
[*]