From - Wed Jul 8 22:15:18 1998 Return-Path: nelson@crynwr.com Received: from norflox.isd.net (norflox [208.153.200.29]) by myco.isd.net (8.8.5/8.7.3) with ESMTP id WAA17340 for ; Tue, 7 Jul 1998 22:17:28 -0500 Received: from ns.crynwr.com (ns.crynwr.com [192.203.178.14]) by norflox.isd.net (8.8.7/8.8.7) with SMTP id XAA32596 for ; Tue, 7 Jul 1998 23:10:19 -0500 Received: (qmail 28686 invoked by uid 0); 8 Jul 1998 04:09:41 -0000 Received: from isdn-8.canton.northnet.org??NOMX? (HELO desk.crynwr.com) (209.2.152.9) by ns.crynwr.com with SMTP; 8 Jul 1998 04:09:41 -0000 Received: (qmail 23335 invoked by uid 501); 8 Jul 1998 04:09:33 -0000 Date: 8 Jul 1998 04:09:33 -0000 Message-ID: <19980708040933.23334.qmail@desk.crynwr.com> From: Russell Nelson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: jhall1@isd.net Subject: Re: Freemacs 1.6g In-Reply-To: <35A28D41.18F011CD@accessmgmt.com> References: <35A26E9A.28885558@accessmgmt.com> <35A279BB.E057FC81@accessmgmt.com> <35A28D41.18F011CD@accessmgmt.com> X-Mailer: VM 6.34 under 20.3 "Vatican City" XEmacs Lucid X-Face: $K'YURj"g6ImvqTS_=]8)gqh!5;ElY<[.Rao%j8r+]iUfE{%|v%F<=mcq<6l{K=~mf&#:?" nslS]U~|x{2V=Eex_I#"9K~9)>?m7Lm={(j_&)SX~fzg&ST~P%QUhc{1p]c3@Zn1u*PZlkHM**X^vV l>GkB5y^Kz%w5p~^uDue]hL&ke,N;+Q Russell, > > Just wanted you to know that I have updated Freemacs 1.6d - it is now > 1.6g ("g=GNU"). BTW, here's some contributions that I never rolled over into Freemacs: >From freemacs-workers-request@sun.soe.clarkson.edu Tue, Feb 04 07:58:26 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Tue, 04 Feb 1992 07:58:26 EST Received: from cheetah.ece.clarkson.edu by uu.psi.com (5.65b/4.1.011392-PSI/PSINet) id AA13424; Tue, 4 Feb 92 05:15:02 -0500 Received: from omnigate.clarkson.edu by cheetah.ece.clarkson.edu (4.1/SMI-4.1) id AA04969; Tue, 4 Feb 92 05:16:07 EST Received: from sun.soe.clarkson.edu by omnigate.clarkson.edu id aa23264; 4 Feb 92 5:03 EST Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA17287; Tue, 4 Feb 92 03:54:26 EST Return-Path: Received: from usenet.INS.CWRU.Edu ([129.22.8.64]) by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA17282; Tue, 4 Feb 92 03:54:22 EST Received: from ncoast.UUCP by usenet.INS.CWRU.Edu with UUCP (5.65b+ida+/CWRU-1.5-UUCPGW) id AA07003; Tue, 4 Feb 92 03:52:36 -0500 (from ncoast!dale for freemacs-workers@sun.soe.clarkson.edu) Received: by NCoast.ORG (5.61/smail2.5/03-30-88) id <9202040554.AA16495@NCoast.ORG>; Tue, 4 Feb 92 00:54:41 -0500 From: Dale Smith Message-Id: <9202040554.AA16495@NCoast.ORG> Subject: Info bugs in 1.16a To: freemacs-workers@sun.soe.clarkson.edu Date: Tue, 4 Feb 92 0:54:41 EST X-Mailer: ELM [version 2.3 PL11] I don't know if this has been fixed or reported before. If it has, just ignore me. :-) No. Wait. TELL me! Info (in v 1.16a) couldn't go to a node that had regexp chars in the node name. Like ** in mintref.eli. I just surrounded the offending arg1's with #(Fregexp-quote,arg1). Seems to work ok. There is another (slight) bug. You can't go to a node with a command that uses Fcompleting-readline if that node has a ? as part of the node name. (like l?) If you type C-q ? it works ok though. Name:Ifind-node-do Search through all the nodes to find the one that matches our name. Return arg2 if we find a match, and arg3 if we don't. [*]#(lp,^,,r) #(l?,.,],,0,( #(sp,0) #(sp,0$>) #(sm,0) #(lp,Node:[ ##(bc,9,d,a)]*#(Fregexp-quote,arg1)[##(bc,9,d,a)(,)],,r) #(l?,.,$,,,( #(lp,^,,r) #(sp,#(l?,.,],1,,1,])) arg2 ),( #(SELF,arg1,(arg2),(arg3)) )) ),( arg3 ))[*] Name:Ilist-nodes-do [*]#(lp,( )) #(l?,.,],,0,( #(sp,0$>) #(lp,Node:[ ##(bc,9,d,a)]*#(Fregexp-quote,arg1),,r) #(l?,.,$,,0,( #(sp,0) #(Floop,(##(sp,<)),##(nc,arg1)) #(lp,[##(bc,9,d,a)(,)],,r) #(l?,.,$,0,,,(#(sm,0,$))) ##(rm,0) (,) )) #(SELF,arg1) ))[*] Name:Ifind-tag Arg1 is the name of the tag whose entry is to be found. [*]#(pm,1) #(lp,#(Fregexp-quote,arg1):[ ##(bc,9,d,a)]*,,r) #(l?,[,$,,0,( #(sp,0) #(lp,[##(bc,9,d,a)(,)],,r) #(Ifind-node,##(rm,#(l?,.,$,0,,0,$))) )) #(pm) [*] -- Dale P. Smith ( **unemployed** !!!) dale@ncoast.org uunet!usenet.ins.cwru.edu!ncoast!dale >From freemacs-help-request@sun.soe.clarkson.edu Fri, Feb 28 20:38:19 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Fri, 28 Feb 1992 20:38:19 EST Received: from cheetah.ece.clarkson.edu by uu.psi.com (5.65b/4.1.011392-PSI/PSINet) id AA13315; Fri, 28 Feb 92 20:29:32 -0500 Received: from barnacle.erc.clarkson.edu by cheetah.ece.clarkson.edu (4.1/SMI-4.1) id AA01963; Fri, 28 Feb 92 20:31:31 EST Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <05317-0@barnacle.erc.clarkson.edu>; Fri, 28 Feb 1992 20:31:14 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA18774; Fri, 28 Feb 92 19:30:36 EST Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA18742; Fri, 28 Feb 92 19:26:48 EST Return-Path: Received: from iesd.auc.dk ([130.225.48.4]) by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA18737; Fri, 28 Feb 92 19:26:37 EST Received: by iesd.auc.dk (5.61++/IDA-1.2.8) id AA25217; Sat, 29 Feb 92 01:23:41 +0100 Newsgroups: iesd.mail.freemacs-announce Path: iesd.auc.dk!richard From: richard@iesd.auc.dk (Richard Flamsholt S0rensen) Subject: Re: Latex package for Freemacs 1.6a In-Reply-To: Richard Flamsholt S0rensen's message of 3 Feb 92 01:41:08 Message-Id: Sender: root@iesd.auc.dk (Operator) Organization: Mathematics and Computer Science, University of Aalborg References: <9201290348.AA06439@cheetah.ece.clarkson.edu> Date: 29 Feb 92 01:23:42 Lines: 22 Apparently-To: freemacs-announce@sun.soe.clarkson.edu me> The LaTeX-mode package is also available for anonymous ftp here at me> AUC from iesd.auc.dk (130.225.48.4) in the msdos directory. This me> version is always guaranteed to be the newest. A minor correction: it's in the msdos/freemacs dir. Also, I've just uploaded version 2.31, in case you'd like to know -- the old version was 2.23. If you grab the whole freemacs.zoo package it supports a .emacs like file for preferences and settings (called _emacs) which makes it much easier to incorporate new versions of different modes and patches. I'll probably get around to post it on freemacs-help Real Soon Now (actually, we should have a freemacs-source group for short pieces of Mint ... it doesn't really fit into the help group) As always, feel free to mail me if you have any problems, ideas or bugreports -- it's nice to have some feedback. Richard -- Richard Flamsholt richard@iesd.auc.dk >From ncoast!dale@usenet.INS.CWRU.Edu Wed, Feb 26 23:58:53 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Wed, 26 Feb 1992 23:58:53 EST Received: from usenet.INS.CWRU.Edu by uu.psi.com (5.65b/4.1.011392-PSI/PSINet) id AA11871; Wed, 26 Feb 92 23:28:05 -0500 Received: from ncoast.UUCP by usenet.INS.CWRU.Edu with UUCP (5.65b+ida+/CWRU-1.5-UUCPGW) id AA13479; Wed, 26 Feb 92 23:27:54 -0500 (from ncoast!dale for nelson@crynwr.com) Received: by NCoast.ORG (5.61/smail2.5/03-30-88) id <9202270425.AA06449@NCoast.ORG>; Wed, 26 Feb 92 23:25:25 -0500 From: dale@NCoast.ORG (Dale Smith) Message-Id: <9202270425.AA06449@NCoast.ORG> Subject: freemacs 1.6d CCL bug To: nelson@crynwr.com Date: Wed, 26 Feb 92 23:25:24 EST X-Mailer: ELM [version 2.3 PL11] Hello Russ, Thanks for sending me that 1.6d SEARCH.ASM, but would you believe it, there is a bug in it? :-) It seems that case is ALWAYS ignored in character classes. ALWAYS. Here is a fix. I didnd't want to go mucking about in the locate routine, putting jumps around the xlat instructions, so I just re-init the case_translat_table depending on if we want to fold case or not. It tries to be smart and only re-do the table if it needs it. If you have a more elegant or quicker solution, please mail me. dale -- Dale P. Smith ( **unemployed** !!!) dale@ncoast.org uunet!usenet.ins.cwru.edu!ncoast!dale ----------- snip it ------- *** old\search.asm Tue Feb 18 10:41:56 1992 --- search.asm Tue Feb 25 15:57:00 1992 *************** *** 1,4 **** ! ;History:107,1 ;Mon Apr 23 23:22:13 1990 Add \( and \) capability (won't work with *) ;Sun Apr 22 23:30:23 1990 omatch_NCCL bombed on the first failure to match. ;Sun Apr 22 23:12:21 1990 don't bomb locate on null classes. --- 1,5 ---- ! ;History:1218,1 ! ;Tue Feb 25 15:57:01 1992 Case was always folded with CCL's ;Mon Apr 23 23:22:13 1990 Add \( and \) capability (won't work with *) ;Sun Apr 22 23:30:23 1990 omatch_NCCL bombed on the first failure to match. ;Sun Apr 22 23:12:21 1990 don't bomb locate on null classes. *************** *** 1192,1203 **** init_case_table: push bx - mov init_case,offset init_case_2 mov bx,0 init_case_0: mov case_ignore_table[bx],bl inc bl jne init_case_0 ;now translate 'a' to 'A'. mov bx,'a' init_case_1: --- 1193,1205 ---- init_case_table: push bx mov bx,0 init_case_0: mov case_ignore_table[bx],bl inc bl jne init_case_0 + or di,di ; want flat? + je init_case_2 ; no ;now translate 'a' to 'A'. mov bx,'a' init_case_1: *************** *** 1208,1214 **** --- 1210,1228 ---- cmp bx,'z' jbe init_case_1 pop bx + mov init_case,offset init_case_folded + ret init_case_2: + pop bx + mov init_case,offset init_case_flat + ret + init_case_folded: ; we are folded + or di,di ; want flat? + je init_case_table ; yes, re-init + ret + init_case_flat: ; we are flat + or di,di ; want flat? + jne init_case_table ; no, re-init ret --------- more snips ----- >From dale@selad.NCoast.ORG Tue, Mar 17 05:24:51 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Tue, 17 Mar 1992 05:24:51 EST Received: from usenet.INS.CWRU.Edu by uu.psi.com (5.65b/4.1.011392-PSI/PSINet) id AA15943; Tue, 17 Mar 92 05:07:13 -0500 Received: from ncoast.UUCP by usenet.INS.CWRU.Edu with UUCP (5.65b+ida+/CWRU-1.5-UUCPGW) id AA15332; Tue, 17 Mar 92 05:07:13 -0500 (from dale@selad.NCoast.ORG for nelson@crynwr.com) Received: by NCoast.ORG (5.61/smail2.5/03-30-88) id <9203170836.AA21788@NCoast.ORG>; Tue, 17 Mar 92 03:36:25 -0500 Received: by selad.NCoast.ORG (UUPC/extended 1.11n); Wed, 18 Mar 1992 03:21:52 EST Date: Wed, 18 Mar 1992 03:21:51 EST From: "Dale P. Smith" Message-Id: <29c6fda1.selad@selad.NCoast.ORG> To: "Freemacs Workers" , "Russell Nelson" Subject: recursive-edit, kbd-macro fixes,features Here are some changes I made to make recursive edit and keyboard macros a bit more GNUish: Modified F:recursive-edit and Funwind-recurse so they can be called from a keyboard macro. Added recursive-edit and recenter options to F:kbd-macro-query and friends. Modified F:start-kbd-macro so it would append new keys to the old macro if given an argument. Modified F:kbd-macro-query to execute F:recursive-edit if given an argument. Also added an error message if not defining or executing. Name:F:recursive-edit Call with arg1 = code to execute if the user wishes to continue the function. [*] #(n?,recursive-g,( #(Ferror,(Sorry(,) recursive-edit isn't recursive)) ),( #(ds,k,##(gs,Funwind-recurse,#(Farglist))) #(mp,k,#(Farglist)) #(ds,Fmode-parens,([(ARG1)])) #(mp,Fmode-parens,SELF,ARG1) #(ds,recursive-g,##(gs,g)) #(ds,g,##(gs,Fget-key)) #(Fdo-recursive-edit) #(==,##(result),endrecurse,( arg1 ),( #(F:ring-the-bell) )) #(k,foo) )) [*] Name:Funwind-recurse [*]#(==,arg1,,(#(Ferror,Garbled recursive edit))) #(ds,k,##(gs,Fredisplay,#(Farglist))) #(mp,k,#(Farglist)) #(ds,Fmode-parens,((ARG1))) #(mp,Fmode-parens,SELF,ARG1) #(ds,g,##(gs,recursive-g)) #(es,recursive-g) [*] Name:Fkbd-macro-query.C-r [*]#(F:recursive-edit)#(F:kbd-macro-query)[*] Name:Fkbd-macro-query.C-l [*]#(F:recenter)#(F:kbd-macro-query)[*] Name:Fkbd-macro-query.? [*]#(ow,( ' ' to continue. Del to skip the remainder of this one. C-d to skip this one and any remaining repetitions. C-r to enter a recursive edit. C-l to recenter the display. Any other key stops the macro and executes the key. )) #(Fhit-any-key) #(F:kbd-macro-query)[*] Name:F:kbd-macro-query [*] #(n?,kbd-macro-d,( #(==,arg1,,,( #(F:recursive-edit) )) ),( #(n?,kbd-count,( #(==,arg1,,( #(k) #(an,(Proceed with macro? (Space, DEL, C-d, C-r or C-l))) #(Fkbd-macro-query,#(kbd-macro-g)#(an)) ),( #(F:recursive-edit) )) ),( #(Fmessage,Not defining or executing kbd macro) )) )) [*] Name:F:start-kbd-macro Start remembering keys into a keyboard macro. If given an argument, append new keys to last macro. [*] #(n?,kbd-macro-d,( #(Fmessage,You are already defining a key!) ),( #(==,arg1,,( #(ds,kbd-macro) ),( #(n?,kbd-macro,( #(kbd-macro) #(mp,kbd-macro,,###(bc,40,d,a)Frun-kbd-macro(,),##(bc,41,d,a)) ),( #(ds,kbd-macro) )) )) #(ds,kbd-last) #(ds,kbd-macro-g,##(gs,g)) #(ds,g,(#(Fkbd-macro-g,#(kbd-macro-g)))) #(ds,kbd-macro-d,##(gs,d,#(Farglist))) #(mp,kbd-macro-d,#(Farglist)) #(ds,d,( #(kbd-macro-d,char) #(ds,kbd-macro, ##(kbd-macro) ##(kbd-last) ) #(ds,kbd-last) )) #(mp,d,,char) ))[*] >From dale@selad.NCoast.ORG Tue, Mar 17 05:25:00 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Tue, 17 Mar 1992 05:25:00 EST Received: from usenet.INS.CWRU.Edu by uu.psi.com (5.65b/4.1.011392-PSI/PSINet) id AA15962; Tue, 17 Mar 92 05:07:17 -0500 Received: from ncoast.UUCP by usenet.INS.CWRU.Edu with UUCP (5.65b+ida+/CWRU-1.5-UUCPGW) id AA15338; Tue, 17 Mar 92 05:07:17 -0500 (from dale@selad.NCoast.ORG for nelson@crynwr.com) Received: by NCoast.ORG (5.61/smail2.5/03-30-88) id <9203170836.AA21805@NCoast.ORG>; Tue, 17 Mar 92 03:36:27 -0500 Received: by selad.NCoast.ORG (UUPC/extended 1.11n); Wed, 18 Mar 1992 03:23:05 EST Date: Wed, 18 Mar 1992 03:23:03 EST From: "Dale P. Smith" Message-Id: <29c6fdea.selad@selad.NCoast.ORG> To: "Freemacs Workers" , "Russell Nelson" Subject: Display local key bindings I always wanted to be able to see all the local key bindings. Usually, I would just look at the function that entered that mode, but I wanted freemacs to do that for me... So I'm lazy, that's what computers are for. :-) This thing works most of the time, it depends on the contents of ##(local-mode-changes). It won't work with the new #(hk) function that's in the next version of freemacs. While I was at it, I modified Fdescribe-mode so it would show the local bindings. This requires Usplit-and-goto-other-window. If you don't have it, delete the line with it and this one also: #(rd)#(..,#(F:other-window)) Name:U:local-keys [*] #(ds,-SELF,#(Ulocal-keys)) #(Fremember-buffer) #(Usplit-and-goto-other-window) #(Ffind-or-make-buffer,*local-key-bindings*) #(sv,mb,0) #(is,##(-SELF)) #(es,-SELF) #(sp,[) #(sv,mb,2) #(rd)#(..,#(F:other-window)) [*] Name:Ulocal-keys [*]( )Local key bindings for ##(buffer-mode.##(ba,-1))-mode:( )( ) #(ds,-SELF,##(local-mode-changes)) #(mp,-SELF,,###(bc,40,d,a),Funredefine##(bc,44,d,a),##(bc,41,d,a)) #(ds,-SELF,##(sa,#(-SELF,,,(,)))) #(Fmultiple,Ulocal-keys-do,##(-SELF),SELF) #(es,-SELF) [*] Name:Ulocal-keys-do [*] #(ds,-SELF,arg1) #(==,##(gn,-SELF,2),K.,( #(Fpad-with,,##(-SELF), ,16) #(ds,-SELF,##(arg1)) is ##(-SELF)( )))[*] Name:Fdescribe-mode Look for the string ?-arg1-mode-description and (if successful) display it's documention in a new buffer. DPS: Also display local key bindings, even if there is no ?-arg1-mode-description. [*] #(ds,lib-letter,#(Flib-letter,arg1-mode-desc,-)) #(ds,-SELF-keys,#(Ulocal-keys)) #(Ffind-or-make-buffer,*arg1-mode*) #(sv,mb,0) #(sp,[) #(==,##(lib-letter),,( #(is,( No documentation available for )arg1(-mode! )) ),( #(n?,Mfilename,,(#(Fload-lib,minted))) #(is,#(Min-documentation,##(lib-letter), ##(lib-letter)-arg1-mode-description,(##(rm,0)))) )) #(is,##(-SELF-keys)) #(sp,[) #(sv,mb,2) [*] >From dale@selad.NCoast.ORG Tue, Mar 17 05:25:09 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Tue, 17 Mar 1992 05:25:09 EST Received: from usenet.INS.CWRU.Edu by uu.psi.com (5.65b/4.1.011392-PSI/PSINet) id AA15977; Tue, 17 Mar 92 05:07:21 -0500 Received: from ncoast.UUCP by usenet.INS.CWRU.Edu with UUCP (5.65b+ida+/CWRU-1.5-UUCPGW) id AA15346; Tue, 17 Mar 92 05:07:22 -0500 (from dale@selad.NCoast.ORG for nelson@crynwr.com) Received: by NCoast.ORG (5.61/smail2.5/03-30-88) id <9203170837.AA21850@NCoast.ORG>; Tue, 17 Mar 92 03:37:30 -0500 Received: by selad.NCoast.ORG (UUPC/extended 1.11n); Wed, 18 Mar 1992 03:25:29 EST Date: Wed, 18 Mar 1992 03:25:27 EST From: "Dale P. Smith" Message-Id: <29c6fe7a.selad@selad.NCoast.ORG> To: "Freemacs Workers" , "Russell Nelson" Subject: add-change-log-entry For a more GNUish ChangeLog, Instead of: ##(your-address) Use: ##(bc,40,d,a)##(env.USER) at ##(env.SYSTEM)##(bc,41,d,a) But make sure you have USER and SYSTEM set in your autoexec.bat. What about using ##(env.FULL_NAME) instead of ##(your-name)? Name:U:add-change-log-entry [*] #(F:find-file,.\change.log) #(ds,-SELF,##(ct)) #(sp,[>>>>>>>>>>) #(==,##(rm,[),##(gn,-SELF,10),,( #(sp,[) #(is, ##(ct) ( ) ##(your-name) ( ) ##(your-address) ) #(Fcrlf) #(Fcrlf) )) #(sp,[$) #(Fcrlf) #(Fcrlf) #(is,( * )) #(F:Indented Text-mode) [*] Name:U:add-change-log-entry-other-window [*] #(Fuse-other-window) #(U:add-change-log-entry,arg1) [*] Name:K.C-x 4 a [*]U:add-change-log-entry-other-window[*] >From dale@selad.NCoast.ORG Tue, Mar 17 05:25:17 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Tue, 17 Mar 1992 05:25:17 EST Received: from usenet.INS.CWRU.Edu by uu.psi.com (5.65b/4.1.011392-PSI/PSINet) id AA15991; Tue, 17 Mar 92 05:07:25 -0500 Received: from ncoast.UUCP by usenet.INS.CWRU.Edu with UUCP (5.65b+ida+/CWRU-1.5-UUCPGW) id AA15355; Tue, 17 Mar 92 05:07:25 -0500 (from dale@selad.NCoast.ORG for nelson@crynwr.com) Received: by NCoast.ORG (5.61/smail2.5/03-30-88) id <9203170837.AA21835@NCoast.ORG>; Tue, 17 Mar 92 03:37:29 -0500 Received: by selad.NCoast.ORG (UUPC/extended 1.11n); Wed, 18 Mar 1992 03:24:08 EST Date: Wed, 18 Mar 1992 03:24:06 EST From: "Dale P. Smith" Message-Id: <29c6fe29.selad@selad.NCoast.ORG> To: "Freemacs Workers" , "Russell Nelson" Subject: Suggestion for ct primitive In a previous message by cgb@dit.upm.es: > At first, I made a dired-mode that only had the date and name. But > looking at #(ct), it is easy to notice that small modifications can > make it return also the file size and the attibutes. Well, I did them, > and here is the result. Follows the code for the new ct primitive and > the code for the dired mode, and some patches needed so that find-file > and dired work right with directories. > Well, this is a new dired-mode, hopefully language- and > version-independent and also a new version of the ct primitive that > returns all directory info for a given file. Of course, it could be > improved, so if anyone... I like it! In fact, I had just started playing with something similar about a week or so before I read this. How about adding a second parameter to control the extra stuff? If there is an arg2, return the file size and attributes etc. If no arg2, keep the old format. That way, old code won't break. #(ct) date & time of system #(ct,file) date & time of file #(ct,file,any) attributes, size, date & time of file On a somewhat related note, #(ff) returns filenames in lowercase. If it returned directory names in uppercase, they would sort (with #(sa)) with the directories first. Freemacs gets the names from messy-dos in uppercase anyway, so it would even be faster. :-) Haven't tried it though. Side note: The new #(Fread-dirname) calls #(Ffd-with-paths). Should this be #(Fff-with-paths), or am I missing something? It seems to work with #(Fff-with-paths). Anyway, here is the way I think the new #(ct) should be implemented: [ Remember to change the line in Dput-times to this: #(ds,-SELF, ##(ct,arg1##(-SELF),y)) ] ct_prim: ;Mon Nov 21 11:31:54 1983 call getarg1_filename ;get the filename. jz ct_prim_1 mov dx,offset filename2 mov ah,1ah int 21h mov dx,si ;filename in dx for find_first. mov ah,4eh ;find first matching file mov cx,10h ;find subdirs, too. int 21h jnc ct_prim_3 ;go if we found it. jmp return_null ct_prim_1: mov ah,2ch ;get hhmm into si, ssxx into bp, ddd into al. int 21h mov si,cx mov bp,dx mov ah,2ah ;get mmdd into dx, yyyy into cx. int 21h di_points_fbgn call put_ct jmp return_tos ct_prim_3: di_points_fbgn mov cx,2 call getarg push cx ; save arg2 jcxz ct_prim_6 ; if no attributes ;put attributes ADLSHR mov al,filename2.find_buf_attr and al,37h ;only interesting attributes mov ah,0 mov bx,2 ;binary mov cx,6 call put_number ct_prim_6: ;put C time of file modified mov ax,filename2.find_buf_time ;get the hours mov cl,3 shr ax,cl xor al,al mov si,ax mov ax,filename2.find_buf_time ;get the minutes mov cl,5 shr ax,cl and al,3fh xor ah,ah or si,ax mov ax,filename2.find_buf_time ;get the seconds. mov ah,al xor al,al and ah,1fh shl ah,1 ;but they're twoseconds. mov bp,ax ;we have hhmm in si, ssxx in bp, ddd in al. mov ax,filename2.find_buf_date ;get the months mov cl,3 shl ax,cl and ax,0f00h mov dx,ax mov ax,filename2.find_buf_date ;get the days and ax,1fh or dx,ax mov ax,filename2.find_buf_date ;get the year. shr ah,1 mov al,ah xor ah,ah add ax,1980 mov cx,ax mov al,7 ;use ' ' as the day of the week. ;we have mmdd in dx, yyyy in cx. call put_ct pop cx ; get arg2 jcxz ct_prim_4 ; if no file size mov al,' ' stosb ;and last, put the file size mov ax,word ptr filename2.find_buf_size mov dx,word ptr filename2.find_buf_size+2 cmp dx,10000 jae ct_prim_4 ;null if too big (655350000 bytes) mov cx,10000 div cx mov bx,10 ;old base ten for this or ax,ax ;short file? jz ct_prim_5 push dx mov cx,0 call put_number pop ax mov cx,4 call put_number ct_prim_4: jmp return_tos ct_prim_5: mov ax,dx mov cx,0 call put_number jmp return_tos put_ct: ;we have hhmm in si, ssxx in bp, ddd in al. ;we have mmdd in dx, yyyy in cx. And di_points_fbgn push cx ;squirrel yyyy, ssxx, and hhmm away. push bp push si ;we have mmdd in dx, ddd in al. xor ah,ah ;stuff the day of the week. add al,al add al,al mov si,offset day_of_week add si,ax movsw movsw mov al,dh ;get month (1..12) dec al xor ah,ah ;stuff the month add al,al add al,al mov si,offset months add si,ax movsw movsw mov al,dl ;pushed as dx (get date) mov bx,10 ;do all conversions in decimal. mov ah,0 mov cx,2 call put_number mov al,' ' stosb pop bp ;pushed as cx (get minutes) mov ax,bp ;we need them in a two-byte register. mov al,ah ;get hours mov ah,0 mov cx,2 call put_number mov al,":" stosb mov ax,bp ;get minutes back. mov ah,0 mov cx,2 call put_number mov al,":" stosb pop dx ;get seconds mov al,dh mov ah,0 mov cx,2 call put_number mov al,' ' stosb pop ax ;get the year. mov cx,4 call put_number ret >From dale@selad.NCoast.ORG Tue, Mar 17 05:25:27 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Tue, 17 Mar 1992 05:25:27 EST Received: from usenet.INS.CWRU.Edu by uu.psi.com (5.65b/4.1.011392-PSI/PSINet) id AA15994; Tue, 17 Mar 92 05:07:26 -0500 Received: from ncoast.UUCP by usenet.INS.CWRU.Edu with UUCP (5.65b+ida+/CWRU-1.5-UUCPGW) id AA15359; Tue, 17 Mar 92 05:07:28 -0500 (from dale@selad.NCoast.ORG for nelson@crynwr.com) Received: by NCoast.ORG (5.61/smail2.5/03-30-88) id <9203170837.AA21863@NCoast.ORG>; Tue, 17 Mar 92 03:37:31 -0500 Received: by selad.NCoast.ORG (UUPC/extended 1.11n); Wed, 18 Mar 1992 03:26:36 EST Date: Wed, 18 Mar 1992 03:26:34 EST From: "Dale P. Smith" Message-Id: <29c6febd.selad@selad.NCoast.ORG> To: "Russell Nelson" Subject: Missing GNUish things Some things I added for Freemacs: F:append-to-buffer F:split-line F:backward-delete-char-untabify F:indent-new-comment-line F:center-line (was buggy, deleted blank lines and non-word chars) F:center-region F:center-paragraph F:back-to-indentation Name:K.C-x a [*]F:append-to-buffer[*] Name:F:append-to-buffer Append region to named buffer's point. [*] #(ds,value,#(Frecall-buffer)) #(Fcompleting-readline,Buffer: ,( #(ds,-SELF,##(rm,#(Fmark))) #(Fexcurse-buffer,( #(Fswitch-to-buffer,##(value)) #(is,##(-SELF)) #(Fremember-buffer) )) ),( #(Fmultiple,(Fdelete-n-chars,12),##(ls,(,),buffer-name.##(value)##(2nd-half)),SELF) ),-) [*] Name:F:split-line [*] #(pm,1) #(sm,0,<) #(Fpad-to-column,##(lv,cs)#(Fcrlf)) #(sp,0>) #(pm) [*] Name:K.M-C-o [*]F:split-line[*] Name:F:backward-delete-char-untabify Delete the character before the point, converting tabs to spaces. [*] #(==,##(rm,<),##(bc,9,d,a),( #(is,#(Floop, ,#(--,#(--,##(lv,cs),1),#(dm,<)##(lv,cs)))) ),( #(dm,<) )) [*] Name:K.M-j [*]F:indent-new-comment-line[*] Name:K.M-C-j [*]F:indent-new-comment-line[*] Name:F:indent-new-comment-line [*] #(F:delete-horizontal-space) #(is,##(F-right-comment)) #(Fcrlf) #(n?,comment-indent-hook,( #(comment-indent-hook) ),( #(Fpad-to-column,##(F-comment-column)) )) #(is,##(F-left-comment)) [*] Name:F:center-line Center text based on F-fill-column. [*] #(Fsave-excursion,( #(sp,^) #(F:delete-horizontal-space) #(sp,$) #(F:delete-horizontal-space) #(g?,##(lv,cs),1,( #(Fpad-to-column,##(//,##(--,##(F-fill-column),##(lv,cs)),2)#(sp,^)) )) )) [*] Name:F:center-region [*] #(pm,2) #(mb,#(Fmark),,(#(F:swap-point-and-mark))) #(sm,0,#(Fmark)) #(sm,1,.) #(F:swap-point-and-mark) #(Fcenter-region) #(sp,0) #(pm) [*] Name:Fcenter-region [*] #(F:center-line) #(sp,$>) #(mb,1,,( #(==,##(rc,1),0,,( #(SELF) )) ))[*] Name:F:center-paragraph [*] #(F:mark-paragraph) #(F:center-region) [*] Name:K.M-s [*]F:center-line[*] Name:F:back-to-indentation [*]#(sp,^)#(Ffind-non-blank,>)[*] Name:K.M-m [*]F:back-to-indentation[*] >From cgarcia@teice.es Wed, Apr 01 04:37:23 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Wed, 01 Apr 1992 04:37:23 EST Received: from cheetah.ece.clarkson.edu by uu.psi.com (5.65b/4.1.031792-PSI/PSINet) id AA14139; Wed, 1 Apr 92 03:11:38 -0500 Received: from goya.dit.upm.es ([138.4.2.2]) by cheetah.ece.clarkson.edu (4.1/SMI-4.1) id AA02293; Wed, 1 Apr 92 03:13:54 EST Received: by goya.dit.upm.es (EUnet) (5.65c/7.4); Wed, 1 Apr 1992 02:00:20 -0500 Received: from teice with uucp; Tue, 31 Mar 92 19:30:37 Received: by teice.teice.es (5.57/2.3) Tue, 31 Mar 92 19:30:37 GMT Date: Tue, 31 Mar 92 19:30:37 GMT From: cgarcia@teice.es (Carlos Garcia) Message-Id: <9203311930.AA02891@teice.teice.es> To: nelson@cheetah.ece.clarkson.edu Subject: Re: dired? Cc: cgarcia@teice.es Hello, Russ I'm not sure what posting you are refferring to, but I'm sending you all the functions that I think that are needed to make the dired mode work. What I am not sending is the code that must be assembled into the emacs.exe file to modify the primitive #(ct). If that is what you need, please tell me so. I enclose two things: the code that has to be added to the D library to make the bulk of the Dired mode, and some patches that are needed to make functions in the F library to work correctly with a convention needed to know directories from files: directory names must always end in a backslash, and files must not, as the primitive #(ff) returns. When find-buffer is called with a name, it is first absolutized, and the result is sent to find-file or dired depending of the ending backslash. Also, some functions did not treat right such filenames as .., . and c:\. Hope it is of use to you. See ya, Carlos PS. by the way, last time you mailed to me, you said muy gracias. I appreciated it a lot. But I must say the right way to say it is muchas gracias. PSPS. Maybe I remember. You may be referring to the patch I made for the dired function that made it to be completing-readline and started the whole thing with Pavel. You may not find it because it was not a posting called dired, but a posting with subject Patches and bugs that had barely two or three functions related to dired. If that is the case, go fast to the second appearence to the string "-- ". In any case, any thing outside of this posting was not mint code written by me, so I am sendin this to you for completeness. -- Here starts the code for the dired mode, to be included in the D library. Some functions from the original Dired mode (from version 1.6) may be used tacitly without my knowledge, but I don't think so. Name:Ddired Read a directory in, and go to Dired-mode. Corregido por Carlos Garcia para que funcione en espa'nol [*]#(Fremember-buffer) #(Ffind-buffer,,arg1,( #(D:dired-get) ),( #(Ffind-unused-buffer,arg1) #(Fbuffer-set-fn,arg1) #(D:dired-get) #(Fremember-buffer) #(F:Dired-mode) ))[*] Name:D:dired [*]#(==,(arg1),,( #(ds,value,##(lv,cd)) #(Fread-dirname,dired: ,( #(Ddired,##(value)) )) ),(#(Ddired,(arg1))))[*] Name:D:dired-delete [*]#(sp,^) #(is,D) #(dm,>) #(D:dired-next) [*] Name:D:dired-execute [*]#(pm,1) #(an,Delete all of these files?) #(ds,temp) #(sp,[) #(Ddired-execute-do,( #(ds,temp,##(temp)#(Ddired-filename)(,)) )) #(Fyes-or-no,Delete all of these files?#(Fmore,##(temp)),( #(sp,[) #(Ddired-execute-do,( #(ds,temp,#(de,#(Fbuffer-fn)#(Ddired-filename))) #(==,##(temp),,( #(sp,^) #(dm,$) #(dm,>) ),( #(Fmessage,Trouble deleting #(Ddired-filename): ##(temp)) xxx )) )) #(sv,mb,0) )) #(es,dired-list) #(pm) [*] Name:D:dired-find [*]#(F:find-file,#(Ddired-complete-filename)) [*] Name:D:dired-next [*]#(sp,$>) #(sv,cs,#(D-dired-column)) [*] Name:D:dired-other-window [*]#(==,(arg1),,( #(ds,value,##(lv,cd)) #(Fread-dirname,dired: ,( #(Fuse-other-window) #(Ddired,##(value)) )) ),( #(Fuse-other-window) #(Ddired,(arg1)) ))[*] Name:D:dired-remove [*]#(sp,^) #(dm,>) #(is, ) #(D:dired-next) [*] Name:D:dired-remove-previous [*]#(sp,^<^) #(dm,>) #(is, ) [*] Name:D:dired-rename [*]#(ds,value,#(Fbuffer-fn)#(Ddired-filename)) #(Freadline,Rename to: ,( #(rn,#(Fbuffer-fn)#(Ddired-filename),##(value)) #(mp,value,,\,/,:) #(ds,value,#(Fonly-last,#(value,(,),(,),(,)))) #(sv,cs,#(D-dired-column)) #(dm,$) #(is,##(value)) ),a)[*] Name:Ddired-complete-filename Return the complete filename for this line. [*]#(sv,cs,#(D-dired-column)) #(==,##(rm,>),.,( #(ds,temp,#(Fbuffer-fn)) #(mp,temp,,\,/,:) #(Fall-but-last,#(temp,(\,),(\,),(:,))) ),( #(Fbuffer-fn)#(Ddired-filename) ))[*] Name:Ddired-execute-do Handles doing something on every marked line. [*]#(lp,^D,,r) #(l?,.,],0,,( #(sp,0) #(==,arg1,,( #(SELF,(arg1)) )) ))[*] Name:Ddired-filename [*]#(sp,$) #(==,##(rm,<),\,(#(sp,<))) #(pm,1) #(sv,cs,#(D-dired-column)) ##(rm,0) #(pm) [*] Name:Ddired-hack-dir [*]***[*] Name:Dfilename Directory Editor for Freemacs. [*]dired[*] Name:F!D:dired [*][*] Name:F:Dired-mode This will set the local mode to Dired. The code is contained in the D library. [*]#(D!Dired-mode)[*] Name:D:dired-copy [*]#(ds,value,#(Fbuffer-fn)#(Ddired-filename)) #(Freadline,Copy to: ,( #(ex,#(env.COMSPEC),#(env.SWITCHAR)C copy #(Fbuffer-fn)#(Ddired-filename) ##(value),,nul,nul) ),a)[*] Name:D!Dired-mode [*]#(Fexit-mode,arg1) #(Flocal-bind-key,K.Down Arrow,D:dired-next) #(Flocal-bind-key,K.C-n,D:dired-next) #(Flocal-bind-key,K.n,D:dired-next) #(Flocal-bind-key,K. ,D:dired-next) #(Flocal-bind-key,K.Up Arrow,D:dired-previous) #(Flocal-bind-key,K.C-p,D:dired-previous) #(Flocal-bind-key,K.p,D:dired-previous) #(Flocal-bind-key,K.d,D:dired-delete) #(Flocal-bind-key,K.C-d,D:dired-delete) #(Flocal-bind-key,K.u,D:dired-remove) #(Flocal-bind-key,K.Back Space,D:dired-remove-previous) #(Flocal-bind-key,K.x,D:dired-execute) #(Flocal-bind-key,K.f,D:dired-find) #(Flocal-bind-key,K.v,D:dired-find-read-only) #(Flocal-bind-key,K.o,D:dired-find-other) #(Flocal-bind-key,K.r,D:dired-rename) #(Flocal-bind-key,K.c,D:dired-copy) #(Flocal-bind-key,K.g,D:dired-get) #(Flocal-bind-key,K.?,D:dired-help) #(Fmv,Fself-insert,F!self-insert) #(Fmv,Dinsert,Fself-insert) #(ds,local-mode-changes,##(local-mode-changes)( #(Fmv,Fself-insert,Dinsert) #(Fmv,F!self-insert,Fself-insert) )) #(Fset-modename,Dired) [*] Name:D:dired-find-read-only [*]#(ds,readonly) #(F:find-file,#(Ddired-complete-filename)) #(es,readonly)[*] Name:D:dired-previous [*]#(g?,##(lv,cl),3,(#(sp,^<) #(sv,cs,#(D-dired-column)))) [*] Name:Dput-times Puts the time, attributes and size of the files in the dired buffer [*]#(l?,.,],0,,( #(sp,0) #(==,##(rm,<),\,(#(sp,<))) #(ds,-SELF,##(rm,^)) #(ds,-SELF, ##(ct,arg1##(-SELF))) #(sp,^) #(is,##(-SELF)) #(Fpad-to-column,#(D-dired-column)) #(sp,0) #(dm,>)#(is,( )) #(SELF,(arg1)) ),( #(es,-SELF) ))[*] Name:D:dired-get ADLSHR is derived from the format for fa, and means Attribute, directory, label, system, hidden, read-only [*]#(sp,[) #(dm,]) #(an,Reading directory #(Fbuffer-fn) ...) #(is,##(sa,#(ff,#(Fbuffer-fn)*.*,(,)))) #(sp,[) #(dm,>) #(pm,1) #(lp,(,)) #(Dput-times,#(Fbuffer-fn)) #(pm) #(Fmessage,Reading directory #(Fbuffer-fn) ... done) #(sp,[) #(is, ADLSHR mmm dd hh:mm:ss yyyy length Filename.ext( )---------------------------------------------------------( )) #(sv,mb,0) [*] Name:D-dired-column Column where the filenames are located [*]46[*] -- These are other fixes related to the dired mode. Above all, what needs to be fixed is the way F:find-file deals with files with strange names, such as .. and following the convention that directory names must end in a backslash (\), as is the convention with #(ff). Also, an attempt has been made to make dired and cd to be completing-readline. It works fine for me, but has not been thoroughly tested. Name:F:cd Change the current working directory. [*]#(ds,value,##(lv,cd)) #(Fread-dirname,Change directory: ,( #(sv,cd,##(value)) ))[*] Name:Ffd-with-paths [*]#(ds,path,#(Fonly-path,arg1)) #(==,#(Fmultiple,SELF-do,##(ff,arg1,(,)),SELF),,(##(path)(,)),( #(Fmultiple,SELF-do,##(ff,arg1,(,)),SELF) ))[*] Name:Ffd-with-paths-do [*]#(==,#(Fright,(arg1),1),\,( #(==,(arg1),..\,,( #(==,(arg1),.\,,(##(path)arg1(,))) )) ))[*] Name:Fread-dirname Read a directory name. [*]#(Fcompleting-readline,(arg1),( #(ds,value,#(Fabsolute-filename,##(value))) #(==,#(Fright,##(value),1),\,( arg2 ),( #(Ferror,this is not a directory) )) ),( #(ds,temp,#(Fabsolute-filename,##(value)##(2nd-half))) #(mp,temp,,..) #(Ffd-with-paths, #(==,#(Fright,##(value),1),\,( ##(temp,..)*.* ),( #(==,##(fm,temp,.,!!!),!!!,( ##(temp,..)*.* ),( #(rs,temp) ##(temp,..)* )) )) ) ),\)[*] Fbuffer-set-fn, Fabsolute-filename, and Fabsolute-filename-do must be modified to treat right names such as c:\, .., c:\. and . After I made this, I noticed that Richard Flamsholt (the guy who rewrote latex mode) included another fix for Fabsolute-filename. The problem is that both functions don't do the same. My requirements are that all the result ends in backslash (\) if and only if the argument is a directory, that in certain cases may not end in backslash. The four last test cases must work right. Name:Fbuffer-set-fn If a name is given, set the buffer's filename to it, else get rid of any pre-existing filename. [*]#(==,arg1,,( #(n?,buffer-number.##(ba,-1),( #(mp,last-buffer,,@##(buffer-number.##(ba,-1))(,)) #(es, buffer-filename.##(ba,-1), buffer-name.##(buffer-number.##(ba,-1)), buffer-number.##(ba,-1) ) ),( #(Ferror,buffer ##(ba,-1) has no namearg3) )) ),( #(n?,buffer-number.##(ba,-1),( #(SELF,,,-- but it used to) )) #(==,#(Fright,arg1,2),:\,( #(ds,temp,arg1) ),( #(ds,temp,#(Fonly-fn,arg1)) )) #(==,arg2,,,( #(ds,temp,##(temp)) )) #(n?,buffer-name.##(temp),( #(SELF,arg1,#(==,arg2,,2,(##(++,arg2,1)))) ),( #(ds,buffer-number.##(ba,-1),##(temp)) #(ds,buffer-name.##(temp),##(ba,-1)) #(ds,temp,arg1) #(==,##(go,temp),*,( #(es,buffer-filename.##(ba,-1)) ),( #(ds,buffer-filename.##(ba,-1),#(Fabsolute-filename,arg1)) )) )) ))[*] Name:Fabsolute-filename Given a relative filename, absolutize it. Tests: #(Fabsolute-filename,foo.bar) #(Fabsolute-filename,\foo.bar) #(Fabsolute-filename,/foo.bar) #(Fabsolute-filename,c:/foo.bar) #(Fabsolute-filename,c:\foo.bar) #(Fabsolute-filename,c:\baz/foo.bar) #(Fabsolute-filename,c:\baz/foo.bar) #(Fabsolute-filename,c:\baz//foo.bar) #(Fabsolute-filename,c:\baz/c:foo.bar) #(Fabsolute-filename,c:\baz/c:/foo.bar\.\) #(Fabsolute-filename,c:\.\baz\baz\foo.bar) #(Fabsolute-filename,c:\baz\..\foo.bar\) #(Fabsolute-filename,c:\baz\fie\..\foo.bar) #(Fabsolute-filename,c:foo.bar) #(Fabsolute-filename,a:foo.bar) #(Fabsolute-filename,c:\.\) #(Fabsolute-filename,c:\.) #(Fabsolute-filename,.) #(Fabsolute-filename,c:\gente\..\) [*]#(sv,cd,##(lv,cd), #(ds,temp,arg1) #(mp,temp,,/) #(ds,temp,##(temp,\)) #(==,#(Fright,##(temp),1),\,( #(ds,-SELF,\) ),( #(Fcase,#(Fright,##(temp),2), (\.,(#(ds,-SELF,\))), (:.,(#(ds,-SELF,\))), (#(==,#(Fright,##(temp),3),\..,( #(ds,-SELF,\)) )) ) )) #(==,##(temp),.,(#(ds,-SELF,\))) #(..,##(go,temp)) #(==,##(go,temp),:,( #(rs,temp) #(sv,cd,##(gn,temp,2)) ),( #(rs,temp) )) #(ds,temp,##(temp)) #(ds,temp, #(==,##(go,temp),\,( #(ds,temp1,##(lv,cd)) ##(gn,temp1,2) \##(temp) ),( #(rs,temp) ##(lv,cd)##(temp) )) ) ) #(ds,temp,#(Fonly-last, ##(gn,temp,2) #(mp,temp,,\,:) #(SELF-do,#(temp,(,),(,:,))) )) #(==,#(Fright,##(temp),1),\,( ##(temp) ),( ##(temp)#(-SELF) )) #(es,-SELF) [*] Name:Fabsolute-filename-do Boy do we have to be tricky here. If arg2 and arg3 are empty, then we're done, all we have to do is include the last component of the filename. If arg2 is empty, then we must have gotten two slashes, which means restart from root. The bare comma causes the enclosing Fonly-last to drop the leading junk. If we have a .. *after* this, then drop this component of the pathname. Carlos Garcia: a little bit of concatenation, if x2 = x3 x2 x2, => x3 = () & x2 = (). Before it was only enforced x2=x3, which also stopped if the last two names were equal. Also added better treatment for . item. [*]#(Fcase,arg2, (arg3arg4arg5arg6arg7arg8arg9arg2arg2,arg1), (,( , #(Fabsolute-filename,\#(SELF,arg3,arg4,arg5,arg6,arg7,arg8,arg9)) )), (:,( , #(Fabsolute-filename,arg1:#(SELF,arg3,arg4,arg5,arg6,arg7,arg8,arg9)) )), (..,(#(SELF,arg3,arg4,arg5,arg6,arg7,arg8,arg9))), (.,(#(==,arg1,,( #(SELF,,arg3,arg4,arg5,arg6,arg7,arg8,arg9) ),( #(SELF,arg1,arg3,arg4,arg5,arg6,arg7,arg8,arg9) )))), ( #(==,arg1,.,,(arg1\)) #(SELF,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) ) )[*] This corrects how find-file works with names containing . and .. The problem was that Fff-with-pahts does not work right on a directory (for example, the root directory). I think the function to blame is Fonly-fn, that does not work right for the root directory. Name:F:find-file Make a buffer current if already loaded, or else load it. [*]#(==,arg1,,( #(ds,value,#(Fbuffer-has-fn,( #(Fonly-path,#(Fbuffer-fn)) ),( #(lv,cd) ))) #(ds,F-delete-or-append, ##(F-delete-or-append) #(ds,F-delete-or-append) #(Fread-filename,Find: ,( #(SELF,##(value)) ),dirs okay) ) ),( #(Fremember-buffer) #(ds,temp,#(Fabsolute-filename,arg1)) #(==,#(Fright,##(temp),1),\,( #(Ffind-file-do,##(temp)) ),( #(ds,temp1,#(Fff-with-paths,##(temp))) #(==,,##(temp1),( #(Ffind-file-do,##(temp)) ),( #(Fmultiple,Ffind-file-do,##(temp1),SELF) )) #(es,temp1) )) )) [*] Name:Ffind-file-other-window-do [*] #(==,arg1,,( #(ds,value,#(Fbuffer-fn)) #(Fread-filename,Find file in other window: ,( #(SELF,##(value)) ),dirs okay) ),( #(Fremember-buffer) #(ds,temp,#(Fabsolute-filename,arg1)) #(==,#(Fright,##(temp),1),\,( #(Ffind-file-do,##(temp)) ),( #(ds,temp1,#(Fff-with-paths,##(temp))) #(==,,##(temp1),( #(Ffind-file-do,##(temp)) ),( #(Fmultiple,Ffind-file-do,##(temp1),SELF) )) #(es,temp1) )) )) [*] This corrects a curious bug: it does not work right with names ending in a #, as it gets confused with the brackets. In case it does not get to you, there is a tab between arg1 and the left bracket. Name:Fff-with-paths-do [*]#(ds,temp,arg1 ) #(mp,temp,,#(F-completion-ignored-extensions)) #(==,##(temp),arg1 ,( ##(path)arg1 (,) ))[*] >From dale@selad.NCoast.ORG Wed, Apr 01 07:57:10 EST 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Wed, 01 Apr 1992 07:57:10 EST Received: from usenet.INS.CWRU.Edu by uu.psi.com (5.65b/4.1.031792-PSI/PSINet) id AA25633; Wed, 1 Apr 92 07:06:40 -0500 Received: from ncoast.UUCP by usenet.INS.CWRU.Edu with UUCP (5.65b+ida+/CWRU-1.5-UUCPGW) id AA25227; Wed, 1 Apr 92 07:06:31 -0500 (from dale@selad.NCoast.ORG for nelson@crynwr.com) Received: by NCoast.ORG (5.61/smail2.5/03-30-88) id <9204010613.AA05796@NCoast.ORG>; Wed, 1 Apr 92 01:13:01 -0500 Received: by selad.NCoast.ORG (UUPC/extended 1.11n); Tue, 31 Mar 1992 19:24:44 EST Date: Tue, 31 Mar 1992 19:24:43 EST From: "Dale P. Smith" Message-Id: <29d902cd.selad@selad.NCoast.ORG> Organization: Dale's home machine To: "Russell Nelson" Subject: Fixing bug in 1.6d Hello Russ, Well I found the problem with freemacs 1.6d getting wedged on my cheepo home machine. The ev primitive now defines a string called env.SCREEN which seems to be a copy of the screen when freemacs started. Problem is, the new code doesn't check to see if I have a CGA or not. It copies the screen waiting for the retrace. That never happens on my Hercules clone, at least not at that I/O port. Well, I just NOPed out the branches and Freemacs came up happy. You might want to put a check for CGA around that wait_for_retrace code. Here is the output from the dos 5 fc command: Comparing files EMACSOLD.EXE and EMACS.EXE 0000300D: 72 90 0000300E: FB 90 00003012: 73 90 00003013: FB 90 Just to prove it works, here is the current version: ##(lv,vn) 1.6d I still want the ASM sources though. There is another bug in the regexp code. CRLF in a negative character class doesn't work right. There is a test in there to see if the first 2 chars are CR and LF but it just ignores the outcome of the test. Thanks again (and again!) dale -- Dale P. Smith dale@selad.ncoast.org dale@ncoast.org >From freemacs-workers-request@sun.soe.clarkson.edu Thu, Apr 09 10:36:02 EDT 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Thu, 09 Apr 1992 10:36:02 EDT Received: from cheetah.ece.clarkson.edu by uu.psi.com (5.65b/4.1.031792-PSI/PSINet) id AA12349; Thu, 9 Apr 92 11:28:14 -0400 Received: from by cheetah.ece.clarkson.edu (4.1/SMI-4.1) id AB15501; Thu, 9 Apr 92 11:31:28 EDT Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <21909-0@barnacle.erc.clarkson.edu>; Thu, 9 Apr 1992 07:50:33 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA06555; Thu, 9 Apr 92 07:11:53 EDT Return-Path: <@clvm.clarkson.edu:PKOLAR@cspgas11.bitnet> Received: from omnigate.clarkson.edu by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA06551; Thu, 9 Apr 92 07:11:51 EDT Message-Id: <9204091111.AA06551@sun.soe.clarkson.edu> Received: from clvm.clarkson.edu by omnigate.clarkson.edu id aa09353; 9 Apr 92 7:05 EDT Received: from CLVM.CLARKSON.EDU by CLVM.clarkson.edu (IBM VM SMTP R1.2.2MX) with BSMTP id 0892; Thu, 09 Apr 92 07:08:49 EDT Received: from CSPGAS11.BITNET by CLVM.CLARKSON.EDU (Mailer R2.08) with BSMTP id 3275; Thu, 09 Apr 92 07:08:47 EDT Received: from CSPGAS11 (PKOLAR) by CSPGAS11.BITNET (Mailer R2.07) with BSMTP id 2795; Thu, 09 Apr 92 12:56:12 EDT Date: Thu, 09 Apr 92 12:52:30 EDT From: Pavel Kolar Organization: Institute of Physics CSAS, Prague, CS Subject: attributes in dired mode To: freemacs-workers@sun.soe.clarkson.edu Carlos Garcia opened a new avenue in the dired mode. I think, it is desirable to propose the change of attributes. This change can be carried out by some external program, however it is simple to implement it directly to Freemacs. In the following I propose one possible way how to do it .The code stems from the Carlos Garcia dired mode with modification proposed recently by Dale P. Smith. One should make the following steps: (1) to change the filters for dealing with hidden and system files in ff an ct primitives. (2) to create "ac" primitive (attribute change). The syntax : #(ac,filename,A+|A-|H+|H-|S+|S-|R+|R-) for corresponding change of attributes. Items can be separated by spaces, For instance: #(ac,aaaa.aa,S+ H- ) #(ac,aaaa.aa,H+ H- H+) equivalent with #(ac,aaaa.aa,H+) #(ac,aaaa.aa, S+ H- ) are legal commands. (Spaces are skipped). (3) to add the code for ac primitive (for instance into mintprim.asm) ac_prim: ;primitive for attribute change ;Mon Apr 06 17:39:07 1992 call getarg1_filename ;get the filename. jz return_null push si ;save filename mov dx,offset filename2 mov ah,1ah int 21h mov dx,si ;filename in dx for find_first. mov ah,4eh ;find first matching file mov cx,27h ;find ASHR int 21h ; jnc ac_prim_1 ;go if we found it. jmp ac_prim_9 ;end if not ac_prim_1: mov al,filename2.find_buf_attr push ax ;save attributes mov cx,2 call getarg ;second argument jcxz ac_prim_8 ;no second argument cld ac_prim_2: lodsb cmp al,' ' ;skip spaces if any jz ac_prim_7 push cx mov bx,offset attribute_data mov cx,4 ac_prim_3: cmp al,bx] jz ac_prim_4 ;comparison with ASHR inc bx loop ac_prim_3 pop cx jmp ac_prim_8 ;error in argument ac_prim_4: pop cx dec cx jcxz ac_prim_8 ;incomplete argument lodsb cmp al,'+' jz ac_prim_5 cmp al,'-' jnz ac_prim_8 mov al,bx+4] xor al,0ffh pop dx ;loads attributes and al,dl jmp ac_prim_6 ac_prim_5: ;+ case mov al,bx+4] pop dx or al,dl ;new attributes ac_prim_6: push ax ;save new attributes ac_prim_7: loop ac_prim_2 pop cx ;loads new attributes and cl,27h pop dx ;filename mov ax,4301h int 21h ;sets new attributes jmp return_null ac_prim_8: pop ax ac_prim_9: pop si jmp return_null ;end of ac primitive Further, you should add ac into the function table in emacs.asm. (4) to add the corresponding data to the data segment: attribute_data db 'ASHR',32,4,2,1 (5) the following strings should be added (the correct behaviour also depends on the functions D:dired-get so I repeat the code of Carlos Garcia. Name:D!Dired-mode *]#(Fexit-mode,arg1) #(Flocal-bind-key,K.Down Arrow,D:dired-next) #(Flocal-bind-key,K.C-n,D:dired-next) #(Flocal-bind-key,K.n,D:dired-next) #(Flocal-bind-key,K. ,D:dired-next) #(Flocal-bind-key,K.Up Arrow,D:dired-previous) #(Flocal-bind-key,K.C-p,D:dired-previous) #(Flocal-bind-key,K.p,D:dired-previous) #(Flocal-bind-key,K.d,D:dired-delete) #(Flocal-bind-key,K.C-d,D:dired-delete) #(Flocal-bind-key,K.u,D:dired-remove) #(Flocal-bind-key,K.Back Space,D:dired-remove-previous) #(Flocal-bind-key,K.x,D:dired-execute) #(Flocal-bind-key,K.f,D:dired-find) #(Flocal-bind-key,K.v,D:dired-find-read-only) #(Flocal-bind-key,K.o,D:dired-find-other) #(Flocal-bind-key,K.r,D:dired-rename) #(Flocal-bind-key,K.c,D:dired-copy) #(Flocal-bind-key,K.g,D:dired-get) #(Flocal-bind-key,K.?,D:dired-help) #(Flocal-bind-key,K.a,D:set-attribute) #(Fmv,Fself-insert,F!self-insert) #(Fmv,Dinsert,Fself-insert) #(ds,local-mode-changes,##(local-mode-changes)( #(Fmv,Fself-insert,Dinsert) #(Fmv,F!self-insert,Fself-insert) )) #(Fset-modename,Dired) *] Name:D-attribute-column *]10*] Name:D-attribute-line *]3*] Name:D:set-attribute Move cursor on attribute and toggle it *] #(g?,##(lv,cs),##(D-attribute-column),( #(sv,cs,##(D-attribute-column)) ),( #(g?,##(--,##(D-attribute-column),5),##(lv,cs),( #(sv,cs,##(D-attribute-column)) ),(#(Dset-attribute-do))) )) *] Name:Dset-attribute-do This toggles the attribute bit under cursor *] #(ds,temp,##(lv,cs)) #(ds,temp0,##(rm,>)) #(pm,1) #(sv,cl,#(D-attribute-line)) #(sv,cs,##(temp)) #(ds,temp1,##(rm,>)) #(sp,0) #(ds,temp2,#(Fbuffer-fn)#(Ddired-filename)) #(==,##(temp0),(0),( #(ac,##(temp2),##(temp1)+) ),( #(ac,##(temp2),##(temp1)-) )) #(sv,cs,##(D-dired-column)) #(dm,) #(is, ##(ct,##(temp2),y)) #(Fpad-to-column,##(D-dired-column)) #(pm) #(sv,cs,##(temp)) #(es,temp1,temp2,temp0) *] Name:D:dired-get ADLSHR is derived from the format for fa, and means archive, directory, label, system, hidden, read-only *]#(sp,) #(dm,]) #(an,Reading directory #(Fbuffer-fn) ...) #(is,##(sa,#(ff,#(Fbuffer-fn)*.*,(,)))) #(sp,) #(dm,>) #(pm,1) #(lp,(,)) #(Dput-times,#(Fbuffer-fn)) #(pm) #(Fmessage,Reading directory #(Fbuffer-fn) ... done) #(sp,) #(is, Directory = #(Fbuffer-fn)( )-----------------------------------------------------------------------------( ) ADLSHR mmm dd hh:mm:ss yyyy length Filename.ext( )-----------------------------------------------------------------------------( )) #(sv,mb,0) *] Name:D:dired-previous *]#(g?,##(lv,cl),5,(#(sp,<) #(sv,cs,#(D-dired-column)))) *] Now, in the dired mode you can hit "a" (D:set-attribute) : If the cursor is outside the attribute region, it jumps inside, and you can toggle the attribute under the cursor. The new value of attribute is displayed via ct - primitive, so it is an independent check. I hope it's all. Pavel -------------------------------------------------------------------- Pavel Kolar, kolarp@cspgfu11.bitnet or Institute of Physics, Prague pkolar@cspgas11.bitnet -------------------------------------------------------------------- >From freemacs-workers-request@sun.soe.clarkson.edu Sat, Apr 18 12:41:39 EDT 1992 Received: from uupsi by crynwr.com (UUPC/extended 1.11q) with UUCP; Sat, 18 Apr 1992 12:41:39 EDT Received: from cheetah.ece.clarkson.edu by uu.psi.com (5.65b/4.1.031792-PSI/PSINet) id AA00297; Sat, 18 Apr 92 11:49:54 -0400 Received: from barnacle.erc.clarkson.edu by cheetah.ece.clarkson.edu (4.1/SMI-4.1) id AA22990; Sat, 18 Apr 92 11:52:25 EDT Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <22494-0@barnacle.erc.clarkson.edu>; Sat, 18 Apr 1992 11:51:09 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA05650; Sat, 18 Apr 92 10:58:11 EDT Received: from jp-gate.wide.ad.jp by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA05638; Sat, 18 Apr 92 10:57:48 EDT Received: from creamy.ics.osaka-u.ac.jp by jp-gate.wide.ad.jp (5.65+1.6W/2.8Wb-jp-gate/1.2) with SMTP id AA23071; Sat, 18 Apr 92 23:54:52 JST Received: by creamy.ics.osaka-u.ac.jp (5.64/6.4J.6-creamy-ip.6.33) id AA11566; Sat, 18 Apr 92 23:54:46 +0900 Received: by ouicss.ics.osaka-u.ac.jp (SVMAIL 1.4/6.4J) id AA06105; Sat, 18 Apr 92 23:52:44 JST Received: from sollux.osakac.ac.jp by ntlab.osakac.ac.jp (4.0/6.4J.6) id AA07665; Sat, 18 Apr 92 22:32:17 JST Received: from localhost by sollux.osakac.ac.jp (4.1/6.4J.6) id AA15613; Sat, 18 Apr 92 22:34:13 JST Return-Path: Message-Id: <9204181334.AA15613@sollux.osakac.ac.jp> To: freemacs-announce@sun.soe.clarkson.edu, freemacs-workers@sun.soe.clarkson.edu Reply-To: hry@sollux.osakac.ac.jp Subject: pre-announce and asking for Nihongo freemacs Cc: freemacs@efreet.osakac.ac.jp Date: Sat, 18 Apr 92 22:34:13 +0900 From: Hisashi MINAMINO Hello, this is my first posting to this ML. My friend H.Onishi and I have worked to port freemacs-1.6a for Japanese major personal computer PC-9801 series and its clone. Now he is preparing to post the newsgroup; fj.binaries.msdos. So I wanna make pre-announce, and if you have any comments or suggestions, let me know please. Nihongo freemacs (nfreemacs) topics: o based on freemacs-1.6a o recognizes Nihongo character set (only SHIFT JIS) o bug fix (bugs from original freemacs-1.6a) - regexp search algorithm - hardware scroll up/down o improvement for PC98 - new mint primitives - kanji char operation - Nihongo dired (mint code) - and other Nihongo features o differences from original - SGAP value was changed (0x8x -> 0xfx) for SHIFT JIS code, but MINT code is compatible to original one. *.ed file converter is included to this package. - timer usage (was altered to VSYNC) o new c-mode (mint code) - based on Johnathan Vail's c-mode - like GNU Emacs's c-mode (many customizer variables) nfreemacs is coming soon. PS: "CC: freemacs@efreet.osakac.ac.jp" is our mailing list in Japan. -- Hisashi MINAMINO , Asano lab (Comp Geometry), Dept of Applied Electronic Eng., Osaka Electro-Communication University >From freemacs-help-request@sun.soe.clarkson.edu Sun, Jun 07 21:45:21 EDT 1992 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Sun, 07 Jun 1992 21:45:21 EDT Received: from uu.psi.com by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA19372; Sun, 7 Jun 92 07:56:55 -0400 Received: from cheetah.ece.clarkson.edu by uu.psi.com (5.65b/4.1.031792-PSI/PSINet) id AA04566; Sun, 7 Jun 92 07:56:45 -0400 Received: from barnacle.erc.clarkson.edu by cheetah.ece.clarkson.edu (4.1/SMI-4.1) id AA10201; Sun, 7 Jun 92 08:00:14 EDT Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <10201-0@barnacle.erc.clarkson.edu>; Sun, 7 Jun 1992 07:52:16 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA12742; Sun, 7 Jun 92 07:06:42 EDT Return-Path: Received: from relay1.UU.NET by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA12738; Sun, 7 Jun 92 07:06:38 EDT Received: from goya.uu.es by relay1.UU.NET with SMTP (5.61/UUNET-internet-primary) id AA08141; Sun, 7 Jun 92 07:09:15 -0400 Received: from teice.UUCP by goya.uu.es (EUnet) (5.65c/8.5); Fri, 5 Jun 1992 08:32:06 +0200 Original-Received: by teice.teice.es (5.57/2.3) Thu, 4 Jun 92 08:40:26 GMT Pp-Warning: Illegal Received field on preceding line Date: Thu, 4 Jun 92 08:40:26 GMT From: cgarcia@teice.es (Carlos Garcia) Message-Id: <9206040840.AA20684@teice.teice.es> To: freemacs@sun.soe.clarkson.edu Subject: An improvement to info-mode (albeit small). I made some improvements over the info mode, aimed to a greater functionality and compatibility with GNU. It is not the right solution, because what is needed is a command like GNU's narrow-to-region. I thought about it, but it involves to many changes to the Mint code or a new primitive in the machine code, so this is all I can do. Hope someone else finds it worthy. Improvements over the old mode: fixed some bugs, allowed menu defaults, search and edit commands and use of tag tables. As an addition, Info_Edit mode has all Info commands available (well, almost: search is not), and a create command, to create a new node after the current one. Now a whole file can be accessed with the * name, or the command g(filename) as the Info nodes explained (It's rather slow, though). The use of the tag table improves the speed to the point that all the text copying allows. Another faster approach would have been redefining all movement commands so that even if the buffer is bigger, the user cannot move outside of a region. Also changed all functions that work with input read from user not to pass that input as an argument, but use ##(value) instead, as the other way causes problems when re-scanning. To-do: Info-validate. Known bugs: A control-L (^L) does not end a node. Menu entries cannot contain commas. --- Code ---- Now this checks that the file exists before switching buffers, and once it enters the buffer, sets the mark G to the start of the Tag table, so that its use is speedy enough. Also, it stays in the current node if it does not find the requested one. Name:Ifind-node Copy a node to the *info* buffer. All .eli files are assumed to be on the path given by the EMACS environment variable. Node to find is in the ##(value) string. Uses global mark H. [*]#(n?,info-edit,( #(Fbuffer-modified,( #(sp,[) #(..,##(ba,##(info-buffer))) #(dm,0) #(mb,[,( #(sm,0,<) #(bi,##(buffer-name.*info*),]) #(sm,1)#(sp,0>)#(sm,0)#(sp,1) ),( #(bi,##(buffer-name.*info*),]) #(sm,0,[) )) #(mb,^,(#(is,( )))) #(..,##(ba,##(buffer-name.*info*))) #(I:Info-tagify) )) )) #(ds,-SELF,##(value)) #(==,##(go,-SELF),##(bc,40,d,a),( #(ds,--SELF,##(fm,-SELF,##(bc,41,d,a))) #(ds,value,#(env.EMACS)##(si,Fxlat-lower,##(--SELF)).eli) #(==,##(ff,##(value)),,( #(Ferror,Cannot find ##(value)) ),( #(ds,info-current,##(bc,40,d,a)##(info-file)##(bc,41,d,a)##(info-current)) #(ds,info-file,##(--SELF)) #(Ffind-buffer,,##(value),,( #(Ffind-unused-buffer,##(value)) #(Fvisit-do)#(pm,2) )) )) #(es,--SELF) #(lp,( )Tag table:( )) #(l?,[,],G,,,(#(sm,G,]))) #(ds,info-buffer,##(ba,-1)) ),( #(..,##(ba,##(info-buffer))) #(rs,-SELF) )) #(pm,3) #(sp,[) #(==,##(-SELF),,( #(rs,-SELF) #(ds,-SELF,##(-SELF)Top) #(..,##(fm,-SELF,##(bc,41,d,a))) )) #(ds,value,##(-SELF)) #(SELF-do,( #(sm,H,0) #(pm) #(sm,0,H) #(ds,info-history, ##(info-current) #(==,##(info-current),,,((,))) ##(info-history) ) #(ds,info-current,##(-SELF)) #(..,##(ba,##(buffer-name.*info*))) #(rs,-SELF) #(==,##(go,-SELF),##(bc,40,d,a),( #(Fenter-local-modes) )) #(sp,[) #(dm,]) #(bi,##(info-buffer),0) #(sv,mb,0) #(sp,[) ),( #(sp,2) #(pm) #(..,##(ba,##(buffer-name.*info*))) #(rs,-SELF) #(==,##(go,-SELF),##(bc,40,d,a),( #(Fenter-local-modes) )) #(Fmessage,Node "#(rs,-SELF)##(-SELF)" not found) )) #(es,-SELF) [*] Completely new function. It is not totally compatible with GNU, as in Freemacs one cannot go to the 34234th character in the buffer, and that was the only information contained by the original tag table. So it adds an extra number, that is the line number of the node start. The convention is that the tag table resides from mark G on. This mark is set each time Info loads a new .eli file. Name:I:Info-tagify [*]#(..,##(ba,##(info-buffer))) #(pm,2) #(sp,G) #(dm,]) #(sp,[) #(ds,temp,#(Itag-nodes-do)) #(sp,G<) #(sm,0) #(sp,>) #(is,( )Tag table:( )##(temp)(  )End tag table) #(sp,0>) #(sm,G) #(sp,1) #(mb,G,(#(sp,G))) #(pm) #(..,##(ba,##(buffer-name.*info*))) [*] Name:Itag-nodes-do [*]#(lp,( )) #(l?,.,],,0,( #(sp,0$>) #(lp,Node:[ ##(bc,9,d,a)]*,,r) #(l?,.,$,,0,( #(sp,0) #(lp,[##(bc,9,d,a)(,)],,r) #(l?,.,$,0,,,(#(sm,0,$))) #(sp,^) ##(rm,0)#(rc,[)(,)#(lv,cl)( ) )) #(SELF) ))[*] Now it tries first to look for the entry in the tag table of the given node. Also, regexps are quoted before using them. Node * is also supported, but it does not include the tag table. It would be of no use in regular info mode, and is automatically generated each time the edit mode changes a node. Name:Ifind-node-do Search through all the nodes to find the one that matches ##(value). Return arg1 if we find a match, and arg2 if we don't. [*]#(==,##(value),*,( #(sm,0,[) #(sp,G) arg1 ),( #(sp,G) #(lp,Node:[ ##(bc,9,d,a)]*#(Iregexp-quote-value)[\-0-9]*(,),,r) #(l?,.,],,0,( #(sp,0) #(sv,cl,#(rm,$)) #(sm,0,^) #(lp,^,,r) #(sp,#(l?,.,],1,,1,])) arg1 ),( #(sp,[) #(SELF-do,(arg1),(arg2)) )) )) [*] Name:Ifind-node-do-do [*]#(lp,^,,r) #(l?,.,],,0,( #(sp,0) #(sp,0$>) #(sm,0) #(lp,Node:[ ##(bc,9,d,a)]*#(Iregexp-quote-value)[##(bc,9,d,a)(,)],,r) #(l?,.,$,,,( #(lp,^,,r) #(sp,#(l?,.,],1,,1,])) arg1 ),( #(SELF,(arg1),(arg2)) )) ),( arg2 ))[*] Now, the node listing tries first to use the tag table, and then, as a last resource, searches through the whole file for nodes matching the prefix given. Name:Ilist-nodes-do [*]#(lp,( )) #(l?,.,],,0,( #(sp,0$>) #(lp,Node:[ ##(bc,9,d,a)]*#(Iregexp-quote-value),,r,c) #(l?,.,$,,0,( #(sp,0) #(Floop,(##(sp,<)),##(nc,##(value))) #(lp,[##(bc,9,d,a)(,)],,r) #(l?,.,$,0,,,(#(sm,0,$))) ##(rm,0) (,) )) #(SELF) ))[*] Name:Ilist-nodes-do1 [*]#(lp,Node:[ ##(bc,9,d,a)]*#(Iregexp-quote-value),,r,c) #(l?,.,],,0,( #(sp,0) #(Floop,(##(sp,<)),##(nc,##(value))) #(lp,) #(l?,.,$,0,,,(#(sm,0,$))) ##(rm,0) (,) #(SELF) )) [*] This has also been fixed not to change the status of the point and marks in the info-buffer. Name:Ilist-nodes Make a comma-delimited list of node names. [*]#(..,##(ba,##(info-buffer))) #(pm,2) #(sp,G) #(==,##(rc,]),0,( #(sp,[) #(SELF-do) ),( #(SELF-do1) )) #(sp,1) #(pm) #(..,##(ba,##(buffer-name.*info*))) [*] Now it shows the current value as the default menu entry to go to. Name:I:Info-menu A menu begins with "* Menu:". The prompt is "Menu item: ". line is a comment. After the starting line, every line that begins with a "* " lists a single topic. The name of the topic--the arg that the user must give to the "m" command to select this topic-- comes right after the star and space, and is followed by a colon, spaces and tabs, and the name of the node which discusses that topic. The node name, like node names following Next, Previous and Up, may be terminated with a tab, comma, or newline; it may also be terminated with a period. [*]#(pm,1) #(lp,( )* Menu:) #(l?,[,],,0,( #(pm,1) #(ds,value,#(lp,^\* ,,r) #(l?,^,$,,0,( #(sp,0) #(lp,[:##(bc,9,d,a)],,r) #(l?,.,$,0,,(##(rm,0))) )) ) #(pm) #(sp,0) #(Fcompleting-readline,Menu item: ,( #(Ifind-node,#(Iget-item,( * ))) ),( #(Ilist-items,( )* ) ),-) ),( #(an,No menu!) )) #(pm) [*] This looked from [, instead of ., and it could get confused by fake entries. Name:Iget-item Given the name of an item in ##(value), put the name of the node in the same string. The item prefix is in arg1. * foo: bar 0 1 2 [*]#(pm,3) #(lp,(arg1)##(value),,,c) #(l?,.,],,0,( #(sp, 0 #(Floop,<,##(nc,##(value))) ) #(sm,0) #(lp,:[ ##(bc,9,d,a)]*,,r) #(l?,.,$,1,2,( #(sp,2) #(==,##(rm,>),:,( #(sp,0) #(ds,value,##(rm,1)) ),( #(lp,[. ##(bc,9,d,a)(,)],,r) #(ds,value,##(rm,#(l?,.,$,0,,0,$))) )) )) )) #(pm) [*] This did not look for * Menu: at the beginning of line Name:I:Info-number [*]#(pm,1) #(lp,( )* Menu:) #(l?,[,],,0,( #(sp,0) #(ds,value) #(ds,value,#(Ilist-items,( )* )) #(..,#(Floop,(##(fm,value,(,))),#(--,arg1,1))) #(Ifind-node,#(Iget-item,( * ))) )) #(pm) [*] This has been changed to allow for an Info_Edit mode, where all commands available on info are prefixed by C-c, and editing of nodes is allowed. To create a new node following the current one, Info-create has been made. It is bound to C-c c. To exit Info_Edit mode, C-c C-c, as could be expected. Each time you change node, it is tested for changes. If it has the modified buffer flag, replaces the old node, and a new tag table is built. Now it does not seem to be a problem, but if info buffers are too big, the call to Info-tagify could be changed to simply delete the tag table. The editing of the whole file (node *) does not include the tag table. The convention is that the node to be modified resides between the point and mark 0. No function should modify both things: the point and mark 0. Name:I:Info-mode Set up local key maps for Info Mode. [*]#(Fexit-mode,arg1) #(Flocal-bind-key,K.n,I:Info-next) #(Flocal-bind-key,K.p,I:Info-prev) #(Flocal-bind-key,K.q,I:Info-quit) #(Flocal-bind-key,K.u,I:Info-up) #(Flocal-bind-key,K.m,I:Info-menu) #(Flocal-bind-key,K.d,I:Info-dir) #(Flocal-bind-key,K.f,I:Info-follow) #(Flocal-bind-key,K.l,I:Info-last) #(Flocal-bind-key,K.g,I:Info-goto) #(Flocal-bind-key,K.s,I:Info-search) #(Flocal-bind-key,K.e,I:Info-edit) #(Flocal-bind-key,K.b,I:Info-begin) #(Flocal-bind-key,K.1,(I:Info-number,1)) #(Flocal-bind-key,K.2,(I:Info-number,2)) #(Flocal-bind-key,K.3,(I:Info-number,3)) #(Flocal-bind-key,K.4,(I:Info-number,4)) #(Flocal-bind-key,K.5,(I:Info-number,5)) #(Flocal-bind-key,K. ,F:scroll-up) #(Flocal-bind-key,K.Delete,F:scroll-down) #(Flocal-bind-key,K.Del,F:scroll-down) #(Flocal-bind-key,K.?,I:Info-help) #(Flocal-bind-key,K.h,I:Info-goto-help) #(Fmv,Fself-insert,F!self-insert) #(Fmv,Iinsert,Fself-insert) #(ds,local-mode-changes,##(local-mode-changes)( #(Fmv,Fself-insert,Iinsert) #(Fmv,F!self-insert,Fself-insert) )) #(Fset-modename,Info) [*] Name:I:Info-edit [*]#(==,##(Info-enable-edit),,,( #(I:Info_Edit-mode) #(Fmessage,Type C-c C-c to exit from Info_Edit-mode) ))[*] Name:Info-enable-edit If it is non-null, enables editing of info nodes and files [*]y[*] Name:I:Info_Edit-mode It is similar to info mode, with all keys put with C-c prefix. The string info-edit, when present, makes Ifind-node to save changes to this node before exiting. [*]#(Fexit-mode,arg1) #(ds,info-edit) #(Flocal-bind-key,K.C-c n,I:Info-next) #(Flocal-bind-key,K.C-c p,I:Info-prev) #(Flocal-bind-key,K.C-c q,I:Info-quit) #(Flocal-bind-key,K.C-c u,I:Info-up) #(Flocal-bind-key,K.C-c m,I:Info-menu) #(Flocal-bind-key,K.C-c d,I:Info-dir) #(Flocal-bind-key,K.C-c f,I:Info-follow) #(Flocal-bind-key,K.C-c l,I:Info-last) #(Flocal-bind-key,K.C-c g,I:Info-goto) #(Flocal-bind-key,K.C-c s,I:Info-search-not) #(Flocal-bind-key,K.C-c c,I:Info-create) #(Flocal-bind-key,K.C-c C-c,I:Info-edit-exit) #(Flocal-bind-key,K.C-c b,I:Info-begin) #(Flocal-bind-key,K.C-c 1,(I:Info-number,1)) #(Flocal-bind-key,K.C-c 2,(I:Info-number,2)) #(Flocal-bind-key,K.C-c 3,(I:Info-number,3)) #(Flocal-bind-key,K.C-c 4,(I:Info-number,4)) #(Flocal-bind-key,K.C-c 5,(I:Info-number,5)) #(Flocal-bind-key,K.C-c ,F:scroll-up) #(Flocal-bind-key,K.C-c Delete,F:scroll-down) #(Flocal-bind-key,K.C-c Del,F:scroll-down) #(Flocal-bind-key,K.C-c ?,I:Info-help) #(Flocal-bind-key,K.C-c h,I:Info-goto-help) #(Fset-modename,Info_Edit) [*] Name:I:Info-search-not [*]#(Fmessage,Search not available in Edit mode)[*] Name:I:Info-edit-exit [*]#(es,info-edit) #(Fbuffer-modified,( #(pm,1) #(sp,[) #(..,##(ba,##(info-buffer))) #(dm,0) #(mb,[,( #(sm,0,<) #(bi,##(buffer-name.*info*),]) #(sm,1)#(sp,0>)#(sm,0)#(sp,1) ),( #(bi,##(buffer-name.*info*),]) #(sm,0,[) )) #(mb,^,(#(is,( )))) #(..,##(ba,##(buffer-name.*info*))) #(I:Info-tagify) #(sp,0) #(pm) #(sv,mb,0) )) #(I:Info-mode) [*] Name:I:Info-create [*]#(sp,[) #(..,##(ba,##(info-buffer))) #(dm,0) #(bi,##(buffer-name.*info*),]) #(sp,G) #(sm,0) #(is,( )) #(..,##(ba,##(buffer-name.*info*))) #(dm,]) #(is,File: ##(buffer-number.##(info-buffer))(, Node: , )) #(I:Info-tagify) [*] Just to keep the whole thing consistent. Name:I:Info-help [*] #(ow,( n Go to the next node. p Go to the previous node. u Go up a node. d Directory node. g Goto a node by name. m Select from a Menu. l Last node. f Follow a note. e Edit current node. s Search a string. 1,2,3,4,5 Go that menu entry. ? Show help message. --------Info_Edit------------ C-c Prefix for all commands on Info_edit-mode. C-c c To create a node. )) #(Fhit-any-key) [*] This function has been modified to deal with (filename), that means (filename)* Name:I:Info-goto [*]#(ds,value) #(Fcompleting-readline,Node name: ,( #(==,##(fm,value,##(bc,41,d,a)),,,( #(==,##(value),,( #(rs,value) #(ds,value,##(value)*) ),( #(rs,value) )) )) #(Ifind-node) ),( #(..,##(ba,##(info-buffer))) #(Ilist-nodes) #(..,##(ba,##(buffer-name.*info*))) ),-) [*] Now, menu entries are found case-insensitively. Name:Ilist-items Return a comma-delimited list of those item names that begin with ##(value). The item prefix is in arg1. The initial point is set by arg2. [*]#(pm,2) arg2 #(SELF-do,(arg1)) #(sp,1) #(pm) [*] Name:Ilist-items-do Continue searching until all items have been found. [*]#(lp,(arg1)##(value),,,C) #(l?,.,],,0,( #(sp,0) #(Floop,(##(sp,<)),##(nc,##(value))) #(lp,:) #(l?,.,$,0,,( ##(rm,0) (,) #(SELF,(arg1)) )) ))[*] Now info-search is implemented. Not for use in the info edit mode, though. But there you can get the whole file with node *, or use regular search. Name:I:Info-search Searches through the current info file in search of a value [*]#(ds,value,##(info-search)) #(Freadline,Search: ,( #(==,##(value),,,( #(ds,info-search,##(value)) #(lp,##(value),,,##(F-case-fold-search)) #(pm,1) #(l?,.,],,0,(#(sp,0)#(pm)),( #(pm) #(..,##(ba,##(info-buffer))) #(l?,.,G,,0,( #(ds,info-history, ##(info-current) #(==,##(info-current),,,((,))) ##(info-history) ) #(sp,0) #(lp,^,,r) #(l?,.,[,,0) #(sp,0$>) #(sm,0) #(l?,.,],1) #(sp,1) #(..,##(ba,##(buffer-name.*info*))) #(sp,[) #(dm,]) #(bi,##(info-buffer),0) #(pm,1) #(ds,info-current, #(lp,Node:[ ##(bc,9,d,a)]*,,r) #(l?,[,$,,0,( #(sp,0) #(lp,[##(bc,9,d,a)(,)],,r) #(l?,.,$,0,,,(#(sm,0,$))) ##(rm,0) )) ) #(lp,##(value),,,##(F-case-fold-search)) #(l?,[,],,0,(#(sp,0)),(#(sp,[))) #(pm) #(sv,mb,0) ),( #(..,##(ba,##(buffer-name.*info*))) #(Fmessage,##(value) not found) )) )) )) )) [*] Name:I:Info-follow line is a comment. After the starting line, every line that begins with a "* " lists a single topic. The name of the topic--the arg that the user must give to the "m" command to select this topic-- comes right after the star and space, and is followed by a colon, spaces and tabs, and the name of the node which discusses that topic. The node name, like node names following Next, Previous and Up, may be terminated with a tab, comma, or newline; it may also be terminated with a period. [*]#(ds,value) #(Fcompleting-readline,Note: ,( #(Ifind-node,#(Iget-item,*Note )) ),( #(Ilist-items,*Note ,(#(sp,[))) ),-) [*] Name:Iregexp-quote-value Quote value string so that any metacharacters will be interpreted as ordinary characters. #(ds,value,^$.*[]\ts)#(Iregexp-quote-value)##(value) [*]#(ds,value2,##(value)) #(mp,value2,,^,$,.,*,+,[,],\) ##(value2,\^,\$,\.,\*,\+,\[,\],\\) #(es,value2)[*] Name:Ifind-tag Arg1 is the name of the tag whose entry is to be found. [*]#(pm,1) #(lp,arg1:[ ##(bc,9,d,a)]*,,r) #(l?,[,$,,0,( #(sp,0) #(lp,[##(bc,9,d,a)(,)],,r) #(Ifind-node,#(ds,value,##(rm,#(l?,.,$,0,,0,$)))) )) #(pm) [*] Name:I:Info-dir [*]#(Ifind-node,#(ds,value,((dir)Top)))[*] Name:I:Info-goto-help [*]#(Ifind-node,#(ds,value,((info)Help)))[*] Name:I:Info-last Go back to the node that we visited most recently. [*]#(==,##(info-history),,( #(an,This is the first Info node you looked at) ),( #(Ifind-node,#(ds,value,##(fm,info-history,(,)))) #(..,##(fm,info-history,(,))) )) [*] Name:I:info [*]#(Ffind-or-make-buffer,*info*) #(ds,info-entered-from,#(==,#(Ffirst,#(last-buffer)),,@*scratch*,#(Fsecond,#(last-buffer)))) #(..,##(go,info-entered-from)) #(I:Info-mode) #(Ifind-node,#(ds,value,((dir)Top))) [*] >From @craft.camp.clarkson.edu:raan@hpcvry.cv.hp.com Thu, Jun 11 08:42:31 EDT 1992 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Thu, 11 Jun 1992 08:42:31 EDT Received: from omnigate.clarkson.edu by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA13450; Wed, 10 Jun 92 23:35:27 -0400 Received: from craft.camp.clarkson.edu by omnigate.clarkson.edu id aa06379; 10 Jun 92 23:31 EDT Received: from omnigate.clarkson.edu by craft.camp.clarkson.edu (AIX 3.1/UCB 5.61/4.03) id AA38912; Wed, 10 Jun 92 23:34:56 -0400 Received: from craft.camp.clarkson.edu by omnigate.clarkson.edu id aa06355; 10 Jun 92 23:30 EDT Received: from hp-cv.cv.hp.com by craft.camp.clarkson.edu (AIX 3.1/UCB 5.61/4.03) id AA37885; Wed, 10 Jun 92 23:34:30 -0400 Received: from hp-pcd.cv.hp.com by hp-cv.cv.hp.com with SMTP (16.6/15.5+IOS 3.22+CV 1.0ext) id AA25481; Wed, 10 Jun 92 20:34:23 -0700 Received: from hpcvry.cv.hp.com by hp-pcd.cv.hp.com with SMTP (1.36.108.2/15.5+IOS 3.22+OM+CV 1.0) id AA26478; Wed, 10 Jun 92 20:34:20 -0700 Received: by hpcvry.cv.hp.com (15.11/15.5+IOS 3.22[SMTP-rly]+CV 1.0leaf) id AA11654; Wed, 10 Jun 92 20:34:19 pdt Date: Wed, 10 Jun 92 20:34:19 pdt From: Raan Young Message-Id: <9206110334.AA11654@hpcvry.cv.hp.com> To: nelson@craft.camp.clarkson.edu Subject: Freemacs on HP95LX Hi, I'm a software engineer at HP (the Calculator R&D lab) and I recently completed hacking Freemacs 1.6a to run on the HP95LX Palmtop PC. I thought you would be interested in the changes I made and that you might want to include them in future releases. What follows is a description of the changes. I'm not sure what is the best format for you to work with, so I am not including the actual new source files. Let me know how you would like them packaged and shipped and I'll be glad to send them to you. I should add the caveats that I am not a DOS, 80*86 ASM, or EMACS expert. So why am I doing this, you ask? Because I wanted an editor for binary files and EMACS is the best thing I've found for that. I tried several different PC versions and Freemacs was the best in terms of configurability to allow "easy" binary editing. Doing this has been educational in many ways. The point of all this is that I don't claim to have produced the best 80*86 code, nor to have not missed some DOS-ism, nor to have not introduced some subtle new bug in EMACS. My real world is unix and vi, but I have started to become seriously dependent on my 95 and am trying to make it conform to my ideas of a useful tool. (I've also managed to get the MKS toolkit, including ksh and vi, running on the 95.) I have tested this (only on the 95) and I made a concerted effort to understand what I was modifying and to do modifications in such a way as to not break anything else, nor to impact the way Freemacs would run on other PCs. BTW -- Freemacs 1.6a, as I picked it up (ie unmodified) crashes an HP Vectra 486 -- I did not look into this at all. It dies just after reading emacs.ed with a "no memory" error and it is necessary to reboot the PC. I intend to distribute this version to some other people around HP, but will wait to hear how you want to handle these modifications before distributing on a wider basis. Modifications fall into two catagories: ASM changes, done to deal with differences between the 95 and a regular PC. These were in the area of the display size (95 has a 16x40 display which is a window onto a virtual 25x80 screen) and the clock access in the timed_input area (95 does not support the .01 sec clock info on int 21h). For the display, I made the rc variable setable and added 4 new variables. For the clock I changed it to use int 1ah. The display issue was dealt with by making Freemacs work with a window size smaller than the actual screen size and allowing the user to specify that size. This version of Freemacs thus works with a virtual screen of any size the user chooses to specify. This allows the user to run on either the "real" 25x80 display on the 95, or the physical 16x40 display. Screen sizes are set from environment variables or determined on the basis of the hardware. MINT changes, done to incorporate the ASM changes into the setup process and to deal with a few other oddities in the 95 keyboard mapping. You can reach me with the email address: raan@cv.hp.com Please let me know what you want to do as far as incorporating these changes. I provide them to you freely and without any conditions. Although the current setup message gives me credit for this work I have no great attachment to that. Raan Young Documentation specifics (new #(lv,) and #(sv,) variables): al (Announce Limit) Limit on length of announce and overwrite messages (1..) Value gives the last column on the screen that will be used for writing the mode-line, the mini-buffer line, and any screen overwrites. Note that the value is decremented by one to allow for the scroll-bar. This value is also auto-set by setting either the sc or the rc variables. Setting this value while two windows are enabled will confuse Freemacs, be sure to do a delete- other-windows first. If the environment variable ACOLUMNS exists, value will be set to that on startup, otherwise the value is determined from the hardware. br (Bottommost Row) Limit on number of lines used on screen (1..) Value gives the last line on the screen that will be used by Freemacs, including the mode-line and the mini-buffer line. This value is also auto-set by setting the sr variable. Setting this value while two windows are enabled will confuse Freemacs, be sure to do a delete-other-windows first. If the environment variable VLINES exists, value will be set to that on startup, otherwise it is determined from the hardware. rc (Rightmost Column) Rightmost Column on screen (1..) Virtual number of columns on the screen. Value gives the last column on the screen that will be used for writing the Freemacs window(s). Note that the value is decremented by one for the scroll-bar. This value is also auto-set by setting the sc variable and auto-sets the al variable. Setting this value while two windows are enabled will confuse Freemacs, be sure to do a delete- other-windows first. If the environment variable VCOLUMNS exists, value will be set to that on startup, otherwise it is determined from the hardware. sc (Screen Columns) Actual number of columns on the display Value gives the last physical column on the screen. This value also auto-sets the sc and rc variables. Setting this value while two windows are enabled will confuse Freemacs, be sure to do a delete- other-windows first. If the environment variable COLUMNS exists, value will be set to that on startup, otherwise it is determined from the hardware. sr (Screen Rows) Actual number of rows on the display Value gives the last physical row on the screen. This value also auto-sets the br variable. Setting this value while two windows are enabled will confuse Freemacs, be sure to do a delete-other-windows first. If the environment variable LINES exists, value will be set to that on startup, otherwise it is determined from the hardware. NOTE: The 95 pretends it has a 25x80 display. This means that sc is set to 80 and sr is set to 25, even though the display is actually smaller. Do not lie to the 95, it will get confused. Instead, use the rc and br variables to restrict the screen area to the 16x40 display. The al variable can be set larger to allow the user to see the full message if it exceeds the rc limit. ASM specifics: In ibm.asm -- NOTE -- I did not pay any attention to the impact of the changes on the Z100 version. Add new variables and assign specific initialization values to existing ones. This is necessary to allow the use of a virtual screen that is smaller than the physical one and to have those settings survive an execute request from inside Freemacs. real_columns db 80 real_rows db 25 public screen_rows screen_rows db 25 public announce_limit announce_limit db 79 db 0 ;in case they access it as a word. num_screen_cols db 80 public screen_columns screen_columns db 80 Add routines to handle updating the user setable variables only if the real screen size (as determined from the hardware on start and restart) has changed. This prevents the user settings getting trashed when they fork a shell and assumes the initial values are valid (hence the need to init them as above). set_scr_vars: push ax mov al,real_columns cmp al,screen_columns je set_scr_vars_1 mov screen_columns,al mov num_screen_cols,al dec al mov announce_limit,al set_scr_vars_1: mov al,real_rows cmp al,screen_rows je set_scr_vars_2 mov screen_rows,al dec al dec al dec al mov max_screen_line,al set_scr_vars_2: pop ax ret Changes in the init_entry routine to support above. N: mov real_rows,25 N: mov real_columns,40 O: mov screen_columns,40 O: mov num_screen_cols,40 N: mov real_columns,80 O: mov screen_columns,80 O: mov num_screen_cols,80 N: jne init_entry_6 N: call set_scr_vars N: jmp init_entry_5 ;Yes, ok - but we can't have an EGA. O: je init_entry_5 ;Yes, ok - but we can't have an EGA. N: init_entry_6: N: mov real_columns,cl ;remember how wide it is. O: mov screen_columns,cl ;remember how wide it is. N: mov real_rows,al O: mov max_screen_line,al N: call set_scr_vars O: mov al,screen_columns O: mov num_screen_cols,al N: call clear_screen N: ret Made clear_screen and variants into a public routine. It is used to clear the entire screen, even that area outside the virtual window. The variants allow clearing sections of the screen. This is used to clean up the entire screen after an overwrite or announce with a limit set past the right edge of the virtual window. public clear_screen public clear_prt_scr public clear_rect_scr clear_screen: mov dh,0 clear_prt_scr: mov dl,screen_rows dec dl clear_rect_scr: push bx clear_screen_1: mov bl,screen_columns call clear_count dec dl jns clear_screen_1 pop bx In emacs.asm -- Added new lv and sv primitives to load/store the new variables. extrn screen_rows: byte extrn screen_columns: word extrn announce_limit: word db 'al' ;Announce Limit db 'br' ;Bottommost Row db 'sc' ;Screen Columns db 'sr' ;Screen Rows dw lv_prim_al dw lv_prim_br dw lv_prim_sc dw lv_prim_sr dw sv_prim_al dw sv_prim_br dw sv_prim_sc dw sv_prim_sr extrn clear_screen: near extrn init_screen: near lv_prim_br: mov ah,0 mov al,max_screen_line inc al inc al inc al jmp return_number lv_prim_al: mov ax,announce_limit inc ax jmp return_number lv_prim_sc: mov ax,screen_columns jmp return_number lv_prim_sr: mov ah,0 mov al,screen_rows jmp return_number sv_prim_sr: mov screen_rows,al sv_prim_br: dec al dec al dec al mov max_screen_line,al nuke_screen: call clear_screen call init_screen ret sv_prim_sc: mov screen_columns,ax dec ax mov num_screen_cols,ax inc ax sv_prim_al: dec ax mov announce_limit,ax jmp nuke_screen Modifed input_timed to use int 1ah instead of int 21h. The 95 does not return .01 sec info. These changes should have little effect on the actual Freemacs timing, since according to our DOS experts the .01 sec info is simply derived from 55 ms int in hardware and these changes do essentially the same thing in software (with less accuracy because of rounding to 50 ms int for simplicity). N: mov ah,0 ;get initial clock-ticks N: int 1ah O: mov ah,2ch ;get the current hundreths. O: int 21h N: mov ah,0 ;get new clock-ticks N: int 1ah O: mov ah,2ch ;gtime O: int 21h N: add ax,256 ;make it positive. O: add ax,100 ;make it positive. N: mov dx,ax N: shl ax,1 N: shl ax,1 N: add ax,dx Modified an_prim to use new limit. N: mov bx,announce_limit ;end of the line. O: mov bx,num_screen_cols ;end of the line. In execute.asm -- Modify actually_execute to cancel the affect of init_entry dec num_screen_cols after an execute. N: extrn num_screen_cols: word N: inc num_screen_cols ;fool init_entry if nothings changed In redisp.asm -- Add code to swap the al and rc values to fool chrout into writing past the end of the window if the user has set things up to do that (allows the full screen for messages on the 95). extrn screen_rows: byte extrn announce_limit: byte extrn clear_rect_scr: near swap_al_rc: mov bh,num_screen_cols mov bl,announce_limit mov num_screen_cols,bl mov announce_limit,bh ret Modified chrout to perform the above swap and restore things when done. N: call swap_al_rc ;swap limits N: call swap_al_rc ;back to normal Modified chrout_putch to not write past the limit (which is actually announce_limit because of above swap). N: cmp dh,num_screen_cols ;past the limit? N: jae not_chrout ;yes -- write nothing N: not_chrout: Modified redisplay to clear the screen to the right of the window if an overwrite was done. N: cmp overwrite_flag,0 ;were we overwriting? N: je no_clear ;yes. N: mov dh,num_screen_cols N: inc dh N: mov dl,max_screen_line N: call clear_rect_scr N: no_clear: MINT specifics: Changed to fit on the smaller screen. NOTE -- the setting of window size variables in Fset-variables causes the screen to be cleared. Therefore the copyright info is redisplayed in F&setup-msg. Name:Fhit-any-key [*]#(ow,(-----[Hit any key (space discarded)]----)) #(ds,temp,#(n?,kbd-macro-g,(#(kbd-macro-g)),(#(g)))) #(==,##(temp), ,,( #(Fkbd-in,##(temp)) )) #(rd) [*] Name:F&setup-msg [*]( Freemacs -- Version )#(lv,vn)( Copyright 1986-1990 Russell Nelson HP95LX modifications by Raan Young )[*] Name:Fmode-line [*]#(sv,fc,#(F-mode-fore-color)) #(sv,bc,#(F-mode-back-color)) #(an, #(Fbuffer-modified,*,-,%) #(buffer-number.##(ba,-1)) ##(Fmode-parens,##(buffer-mode.##(ba,-1))#(mode-line-mode)##(minor-modes.##(ba,-1))#(n?,kbd-macro-d, Def)) C#(lv,cs) L#(lv,cl)/#(lv,nl) #(Fwhere) ,a ) #(sv,fc,#(F-fore-color)) #(sv,bc,#(F-back-color)) [*] Name:Fwhere [*]#(g?,#(lv,nl),#(++,#(--,#(lv,bl),##(lv,tl)),1),( #(==,#(lv,cl),1,Top,( #(==,#(lv,cl),#(lv,nl),Bot,(#(lv,pb)%)) )) ),All) [*] Added to get around keyboard mapping on 95. NOTE -- it is also necessary to remove the key binding for KP- [*]Name:Fkey2char.KP+ Map KP+ to + for HP95LX. [*](+)[*] Name:Fkey2char.KP- Map KP- to - for HP95LX. [*](-)[*] Added to make useful "colors" on the 95. NOTE -- there was no F-control-color variable defined. Name:F-whitespace-color Use underline attrib for HP95LX. [*]1[*] Name:F-control-color Use inverse video attrib to flag control characters on HP95LX. [*]112[*] Added to support the new primitive variables and handle mapping environment variables correctly. Note the call to delete-other-windows in the Fset-variables routine. Note also that the setting order in Fset-variables is important. Name:F-screen-columns Set real screen width. [*]#(n?,env.COLUMNS,#(env.COLUMNS),#(lv,sc))[*] Name:F-rightmost-column Set virtual screen width. [*]#(n?,env.VCOLUMNS,#(env.VCOLUMNS),#(F-screen-columns))[*] Name:F-announce-limit Set announce width limit. [*]#(n?,env.ACOLUMNS,#(env.ACOLUMNS),#(F-rightmost-column))[*] Name:F-screen-rows Set real screen height. [*]#(n?,env.LINES,#(env.LINES),#(lv,sr))[*] Name:F-bottommost-row Set virtual screen height. [*]#(n?,env.VLINES,#(env.VLINES),#(F-screen-rows))[*] Name:Fset-variables Set primitive variables to emacs values. [*]#(sv,ws,#(F-visible-whitespace)) #(sv,ts,#(F-top-percent)) #(sv,bs,#(F-bottom-percent)) #(sv,fc,#(F-fore-color)) #(sv,bc,#(F-back-color)) #(sv,wc,#(F-whitespace-color)) #(sv,as,#(F-auto-save)) #(sv,is,#(F-inhibit-snow)) #(sv,tc,#(F-tab-columns)) #(sv,bp,#(F-bell-pitch)) #(sv,cc,#(F-control-color)) #(F:delete-other-windows) #(sv,sc,#(F-screen-columns)) #(sv,rc,#(F-rightmost-column)) #(sv,al,#(F-announce-limit)) #(sv,sr,#(F-screen-rows)) #(sv,br,#(F-bottommost-row)) [*] I have made many other changes at the MINT level, both to meet my own preferences and to squash this down enough to fit on a 128K ram card. These include things like ripping out abbrev, history, grep, dired, most of the help stuff, and all edd files. To compensate, I have written an fv function which is similar to ef, but puts the functions in a read-only buffer and throws the buffer away when C-c C-c is used. This makes up (a little) for losing all the edd stuff. It is invoked from the shortened help menu. I've also changed quoted-char to allow hex and octal entry of all possible byte values (0-255) and added a literal key mode that returns the "raw" key label generated by it. You can still enter control chars with C-q C-*. Let me know if you are interested in any of this stuff. >From @barnacle.erc.clarkson.edu:freemacs-workers-request@sun.soe.clarkson.edu Mon, Aug 10 22:40:04 EDT 1992 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Mon, 10 Aug 1992 22:40:04 EDT Received: from uu.psi.com by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA23952; Mon, 10 Aug 92 22:05:23 -0400 Received: from cheetah.ece.clarkson.edu by uu.psi.com (5.65b/4.1.031792-PSI/PSINet) id AA15314; Mon, 10 Aug 92 22:05:15 -0400 Received: from by cheetah.ece.clarkson.edu (4.1/SMI-4.1) id AB13608; Mon, 10 Aug 92 22:09:27 EDT Received: from barnacle.erc.clarkson.edu by omnigate.clarkson.edu id aa22397; 10 Aug 92 21:01 EDT Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <23216-0@barnacle.erc.clarkson.edu>; Mon, 10 Aug 1992 21:06:07 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA23013; Mon, 10 Aug 92 20:43:49 EDT Return-Path: Received: from usenet.INS.CWRU.Edu (usenet.cwru.edu) by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA23008; Mon, 10 Aug 92 20:43:47 EDT Received: from ncoast.UUCP by usenet.INS.CWRU.Edu with UUCP (5.65b+ida+/CWRU-1.5.2-UUCPGW) id AA01929; Mon, 10 Aug 92 19:48:48 -0400 (from ncoast!dale for freemacs-workers@sun.soe.clarkson.edu) Received: by ncoast.org (/\==/\ Smail3.1.25.1 #25.1) id ; Mon, 10 Aug 92 19:14 EDT Message-Id: From: Dale Smith Subject: Re: 1.6d hangs on my computer To: freemacs-workers@sun.soe.clarkson.edu Date: Mon, 10 Aug 92 19:14:19 EDT In-Reply-To: <9208101555.AA06598@haas.berkeley.edu>; from "Richard Stanton" at Aug 10, 92 8:55 am X-Mailer: ELM [version 2.3 PL11] > > I just unzipped 1.6d and tried to run it on my machine, a 12MHz 286 > with Hercules compatible video. I renamed the original EMACS directory, and > typed "EMACS". The EMACS announcement appeared, and "ev" was visible at > the bottom right corner of the screen, but nothing else happened and I had > to reboot. > > Richard Stanton > I don't have the sources yet (mail servers are slow), but here are the branches I NOP'ed out to get 16d to run on my hercules card. This is the output from the dos 5 FC command: Comparing files EMACSOLD.EXE and EMACS.EXE 0000300D: 72 90 0000300E: FB 90 00003012: 73 90 00003013: FB 90 Hope this helps. dale -- Dale P. Smith ( **unemployed** !!!) dale@ncoast.org uunet!usenet.ins.cwru.edu!ncoast!dale >From freemacs-workers-request@sun.soe.clarkson.edu Fri, Aug 14 20:13:08 EDT 1992 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Fri, 14 Aug 1992 20:13:08 EDT Received: from uu.psi.com by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA14760; Fri, 14 Aug 92 17:06:25 -0400 Received: from cheetah.ece.clarkson.edu by uu.psi.com (5.65b/4.1.031792-PSI/PSINet) id AA14985; Fri, 14 Aug 92 17:06:05 -0400 Received: from barnacle.erc.clarkson.edu by cheetah.ece.clarkson.edu (4.1/SMI-4.1) id AA06623; Fri, 14 Aug 92 17:09:58 EDT Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <15917-0@barnacle.erc.clarkson.edu>; Fri, 14 Aug 1992 17:06:35 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA07160; Fri, 14 Aug 92 16:40:05 EDT Return-Path: Received: from ucbvax.Berkeley.EDU by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA07151; Fri, 14 Aug 92 16:39:52 EDT Received: from ucivax.UUCP by ucbvax.Berkeley.EDU (5.63/1.43) id AA14547; Fri, 14 Aug 92 13:35:35 -0700 Received: from ucivax by q2.ics.uci.edu id aa25008; 14 Aug 92 13:17 PDT Received: by dhw68k.cts.com (smail2.5) id AA08684; 14 Aug 92 09:59:01 PDT (Fri) Received: by sivs.com (smail2.5) id AA04359; 14 Aug 92 09:29:43 PDT (Fri) Subject: Fix to earlier posted patch: initialization on monochrome adapters To: freemacs-workers@sun.soe.clarkson.edu Date: Fri, 14 Aug 92 9:29:42 PDT From: Hugh Daschbach X-Mailer: ELM [version 2.3 PL11] Message-Id: <9208140929.AA04359@sivs.com> Oops. I posted my patch without thorough testing. It fixed the initialization problem much the same as Russ's posting described, but it broke #(ex). Here it is again, without breaking #(ex). *** execute.asm Thu Jun 13 23:07:34 1991 --- ../src.mod/execute.asm Thu Aug 13 22:15:06 1992 *************** *** 1,4 **** ! ;History:134,1 ;Sun Mar 26 20:54:16 1989 remove reference to textseg. ;03-27-88 14:27:20 remove execute_filter code. ;03-13-88 12:26:39 remove the execute filter stuff. --- 1,5 ---- ! ;History:342,1 ! ;Tue Aug 11 21:55:26 1992 Resolve TASM's confusion over forward reference ;Sun Mar 26 20:54:16 1989 remove reference to textseg. ;03-27-88 14:27:20 remove execute_filter code. ;03-13-88 12:26:39 remove the execute filter stuff. *************** *** 281,287 **** ret xms_execute_2: ;endif ;swap out the memory used by reload routine ! mov emm_parm.bcountl,reload_swap_size mov emm_parm.bcounth,0 mov emm_parm.dhandle,dx mov emm_parm.doffset.offs,0 --- 282,289 ---- ret xms_execute_2: ;endif ;swap out the memory used by reload routine ! mov ax,reload_swap_size ! mov emm_parm.bcountl,ax mov emm_parm.bcounth,0 mov emm_parm.dhandle,dx mov emm_parm.doffset.offs,0 *************** *** 335,342 **** sbb dx,0 mov r_emmp.bcountl,ax mov r_emmp.bcounth,dx ! add r_emmp.doffset.offs,reload_swap_size ! mov r_emmp.soffset.offs,reload_swap_size+100h cmp echo_flag,0 ;if echo flag set je xms_execute_4 --- 337,346 ---- sbb dx,0 mov r_emmp.bcountl,ax mov r_emmp.bcounth,dx ! mov ax,reload_swap_size ! add r_emmp.doffset.offs,ax ! add ax,100h ! mov r_emmp.soffset.offs,ax cmp echo_flag,0 ;if echo flag set je xms_execute_4 *** ibm.asm Wed Aug 14 23:07:02 1991 --- ../src.mod/ibm.asm Tue Aug 11 21:26:54 1992 *************** *** 1,4 **** ! ;History:1116,1 ;Wed Aug 14 22:47:30 1991 restore the screen to whence it came, not one line lower. ;Sat May 04 22:20:32 1991 possible bug in pick_init. ;Sun May 13 23:24:24 1990 Add a "scroll_bar" variable. --- 1,5 ---- ! ;History:1141,34 ! ;Tue Aug 11 21:25:44 1992 Eliminate retrace wait in read_chars ;Wed Aug 14 22:47:30 1991 restore the screen to whence it came, not one line lower. ;Sat May 04 22:20:32 1991 possible bug in pick_init. ;Sun May 13 23:24:24 1990 Add a "scroll_bar" variable. *************** *** 1128,1133 **** --- 1129,1137 ---- pop es assume ds:nothing, es:nothing + cmp ibm_cga,0 ;slow refresh? + je read_line_2 + mov dx,crt_status ;load it only once. read_line_1: retrace_wait *************** *** 1134,1139 **** --- 1138,1150 ---- lodsw ;get our char into bx. stosb loop read_line_1 + jmp short read_line_3 + + read_line_2: + rep movsw + + read_line_3: + pop ds pop dx ret __ Hugh Daschbach hugh@sivs.com Member of the League for Programming Freedom -- write to league@prep.ai.mit.edu >From freemacs-workers-request@sun.soe.clarkson.edu Thu, Aug 13 15:05:25 EDT 1992 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Thu, 13 Aug 1992 15:05:25 EDT Received: from uu.psi.com by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA22153; Thu, 13 Aug 92 14:35:32 -0400 Received: from cheetah.ece.clarkson.edu by uu.psi.com (5.65b/4.1.031792-PSI/PSINet) id AA10843; Thu, 13 Aug 92 14:35:15 -0400 Received: from barnacle.erc.clarkson.edu by cheetah.ece.clarkson.edu (4.1/SMI-4.1) id AA05584; Thu, 13 Aug 92 14:38:04 EDT Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <07526-0@barnacle.erc.clarkson.edu>; Thu, 13 Aug 1992 14:07:55 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA13486; Thu, 13 Aug 92 13:54:25 EDT Return-Path: Received: from ucbvax.Berkeley.EDU by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA13481; Thu, 13 Aug 92 13:54:21 EDT Received: from ucivax.UUCP by ucbvax.Berkeley.EDU (5.63/1.43) id AA22164; Wed, 12 Aug 92 03:38:30 -0700 Received: from ucivax by q2.ics.uci.edu id aa29665; 12 Aug 92 3:27 PDT Received: by dhw68k.cts.com (smail2.5) id AA09940; 12 Aug 92 02:08:20 PDT (Wed) Received: by sivs.com (smail2.5) id AA00179; 11 Aug 92 22:50:30 PDT (Tue) Subject: Patch for initialization failure on monochrome adapter To: freemacs-workers@sun.soe.clarkson.edu Date: Tue, 11 Aug 92 22:50:29 PDT From: Hugh Daschbach X-Mailer: ELM [version 2.3 PL11] Message-Id: <9208112250.AA00179@sivs.com> I encountered the same initialization problem previously described by Richard Stanton and Dale Smith. It seems to be a problem only on monochrome display adapters. I believe the following patch will resolve the problem (as well as a compatibility problem with tasm 3.0). Thank you, Russ, for 1.6d. I very much like the mint source organization. It is great to be able to grep and edit regular source files. *** execute.asm Thu Jun 13 23:07:34 1991 --- ../src.mod/execute.asm Tue Aug 11 21:57:52 1992 *************** *** 1,4 **** ! ;History:134,1 ;Sun Mar 26 20:54:16 1989 remove reference to textseg. ;03-27-88 14:27:20 remove execute_filter code. ;03-13-88 12:26:39 remove the execute filter stuff. --- 1,5 ---- ! ;History:285,36 ! ;Tue Aug 11 21:55:26 1992 Resolve TASM's confusion over forward reference HDD ;Sun Mar 26 20:54:16 1989 remove reference to textseg. ;03-27-88 14:27:20 remove execute_filter code. ;03-13-88 12:26:39 remove the execute filter stuff. *************** *** 281,287 **** ret xms_execute_2: ;endif ;swap out the memory used by reload routine ! mov emm_parm.bcountl,reload_swap_size mov emm_parm.bcounth,0 mov emm_parm.dhandle,dx mov emm_parm.doffset.offs,0 --- 282,289 ---- ret xms_execute_2: ;endif ;swap out the memory used by reload routine ! mov ax,reload_swap_size ! mov emm_parm.bcountl,ax mov emm_parm.bcounth,0 mov emm_parm.dhandle,dx mov emm_parm.doffset.offs,0 *************** *** 335,342 **** sbb dx,0 mov r_emmp.bcountl,ax mov r_emmp.bcounth,dx ! add r_emmp.doffset.offs,reload_swap_size ! mov r_emmp.soffset.offs,reload_swap_size+100h cmp echo_flag,0 ;if echo flag set je xms_execute_4 --- 337,345 ---- sbb dx,0 mov r_emmp.bcountl,ax mov r_emmp.bcounth,dx ! mov ax,reload_swap_size+100h ! add r_emmp.doffset.offs,ax ! mov r_emmp.soffset.offs,ax cmp echo_flag,0 ;if echo flag set je xms_execute_4 *** ibm.asm Wed Aug 14 23:07:02 1991 --- ../src.mod/ibm.asm Tue Aug 11 21:26:54 1992 *************** *** 1,4 **** ! ;History:1116,1 ;Wed Aug 14 22:47:30 1991 restore the screen to whence it came, not one line lower. ;Sat May 04 22:20:32 1991 possible bug in pick_init. ;Sun May 13 23:24:24 1990 Add a "scroll_bar" variable. --- 1,5 ---- ! ;History:1141,34 ! ;Tue Aug 11 21:25:44 1992 Eliminate retrace wait in read_chars HDD ;Wed Aug 14 22:47:30 1991 restore the screen to whence it came, not one line lower. ;Sat May 04 22:20:32 1991 possible bug in pick_init. ;Sun May 13 23:24:24 1990 Add a "scroll_bar" variable. *************** *** 1128,1133 **** --- 1129,1137 ---- pop es assume ds:nothing, es:nothing + cmp ibm_cga,0 ;slow refresh? + je read_line_2 + mov dx,crt_status ;load it only once. read_line_1: retrace_wait *************** *** 1134,1139 **** --- 1138,1150 ---- lodsw ;get our char into bx. stosb loop read_line_1 + jmp short read_line_3 + + read_line_2: + rep movsw + + read_line_3: + pop ds pop dx ret -- Hugh Daschbach hugh@sivs.com Member of the League for Programming Freedom -- write to league@prep.ai.mit.edu >From freemacs-workers-request@sun.soe.clarkson.edu Mon, Sep 14 08:53:16 EDT 1992 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Mon, 14 Sep 1992 08:53:16 EDT Received: from barnacle.erc.clarkson.edu by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA12989; Mon, 14 Sep 92 02:35:40 -0400 Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <03116-1@barnacle.erc.clarkson.edu>; Sun, 13 Sep 1992 04:47:59 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA05021; Sun, 13 Sep 92 03:45:17 EDT Received: from TAUNIVM.TAU.AC.IL by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA05008; Sun, 13 Sep 92 03:45:02 EDT Received: from TAURUS.BITNET by TAUNIVM.TAU.AC.IL (IBM VM SMTP V2R1) with BSMTP id 5948; Sun, 13 Sep 92 09:46:17 IST From: nimrod Return-Path: Received: from virgo (virgo-mb.math.tau.ac.il) by math.tau.ac.il (4.1/TAU-4.8) id AA02015; Sun, 13 Sep 92 10:48:53 IDT Comments: If you have trouble reaching this host as math.tau.ac.il Please use the old address: user@taurus.bitnet Reply-To: nimrod Received: by virgo (4.1/TAUSUB-2.0) id AA03214; Sun, 13 Sep 92 09:49:22+020 Date: Sun, 13 Sep 92 09:49:22+020 From: nimrod Message-Id: <9209130749.AA03214@virgo> To: freemacs-workers@sun.soe.clarkson.edu Subject: C auto-indenting right-brace Ever wished that when writing a piece of code like: if ((condition1) || (condition2)) { code; } the closing brace will auto-indent to the indentation of the "if", and not to that of the opening-brace ? Well, if you did (and I did), here's a fix to Cget-Indent the looks if the closing brace is preceded by a right-parenthesis, and if so - get the indentation of the line with the matching left-parenthesis. Name:Cget-indent Return the indenting of the current line. [*]#(pm,5) #(sm,3,[) #(lp,##(bc,41,d,a)[ ##(bc,9,d,a)]*,,r) #(..,#(==,#(l?,.,^,,,y),y,(#(Fflash-paren-do,0,(##(bc,40,d,a)),(##(bc,41,d,a)))) #(lp,[ ##(bc,9,d,a)]*,,R) #(l?,^,$,0,1) #(sp,0) ##(rm,1) #(sp,4) #(pm)[*] Good luck, Nimrod. >From freemacs-workers-request@sun.soe.clarkson.edu Thu, Jan 14 21:44:23 EST 1993 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Thu, 14 Jan 1993 21:44:23 EST Received: from barnacle.erc.clarkson.edu by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA28783; Thu, 14 Jan 93 17:01:25 -0500 Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <20786-0@barnacle.erc.clarkson.edu>; Thu, 14 Jan 1993 17:05:04 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA29481; Thu, 14 Jan 93 16:12:49 EST Return-Path: Received: from VAX01.AMS.ORG ([130.44.1.4]) by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA29468; Thu, 14 Jan 93 16:12:39 EST Received: from MATH.AMS.ORG by MATH.AMS.ORG (PMDF #2306 ) id <01GTIC8SK1DCF4ED67@MATH.AMS.ORG>; Thu, 14 Jan 1993 16:12:50 EST Date: 14 Jan 1993 16:12:50 -0500 (EST) From: Michael Downes Subject: Mint questions To: freemacs-workers@sun.soe.clarkson.edu Message-Id: <727045970.287893.MJD@math.ams.org> Content-Transfer-Encoding: 7BIT Mail-System-Version: Some vacation time lately gave me a chance to work on my Freemacs customizations a little, and turn up a few comments and questions. 1. It looks like there might be an erroneous jump in the code for #(bi): the third argument is returned active if and only if NO error occurred, instead of being returned active if and only if an error occurred. 2. How about changing two-word key names to be one word? Back Space --> BackSpace Up Arrow --> UpArrow Pg Up -- PgUp etc. 3. Fkill-to-buffer-one uses an extra (second) argument for #(ba): #(..,##(ba,1,a)) What does the "a" do? 4. Use or nonuse of #(mp) on a string as a flag for treating 8-bit characters literally seems unreliable, because #(mp) is used to perform some kinds of editing operations, witness the way the list last-buffer is modified in Fremember-buffer. Such operations might well be desirable on text containing 8-bit characters. Unfortunately I don't have a whiz-bang alternative to suggest. The only thing that came to mind was using char 255 as an argument flag, i.e. when the string pointer hits char 255, it discards it but then treats the following character as an argument marker with everything after that going much the same as in current Mint. But this would be problematic if you want to use char 255 for itself in the text being edited. ====================================================================== Item 1 came to my attention while I was trying to write a function corresponding to GNU Emacs eval-defun, which looks around the current cursor position to find a definable function, then defines it. This is handy when working on code and you want to be able to reexecute a function definition while debugging and moving around in the code. I'll send the stuff by separate mail in case anyone is interested in trying it out. Michael Downes mjd@math.ams.org (Internet) >From freemacs-workers-request@sun.soe.clarkson.edu Thu, Jan 14 21:45:49 EST 1993 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Thu, 14 Jan 1993 21:45:49 EST Received: from barnacle.erc.clarkson.edu by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA13103; Thu, 14 Jan 93 18:34:42 -0500 Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <22607-0@barnacle.erc.clarkson.edu>; Thu, 14 Jan 1993 18:05:02 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA01037; Thu, 14 Jan 93 17:06:06 EST Return-Path: Received: from VAX01.AMS.ORG ([130.44.1.4]) by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA01006; Thu, 14 Jan 93 17:05:58 EST Received: from MATH.AMS.ORG by MATH.AMS.ORG (PMDF #2306 ) id <01GTIC8SK1DCF4ED67@MATH.AMS.ORG>; Thu, 14 Jan 1993 17:06:33 EST Date: 14 Jan 1993 17:06:33 -0500 (EST) From: Michael Downes Subject: Files to follow To: freemacs-workers@sun.soe.clarkson.edu Message-Id: <727049193.649892.MJD@math.ams.org> Content-Transfer-Encoding: 7BIT Mail-System-Version: I am sending by separate mail three files: mjd-f.min, mjd-m,min, mjd-u.min. The main stuff that I had promised to send is the functions M:eval-defun and M:eval-buffer in mjd-m.min. Mjd-f.min contains Fprompt-with-default required by M:eval-defun, and I have thrown in one or two other functions I had lying around that might be useful to someone. Mjd-u.min contains a function for timing Mint code, and a set-variable function since I seem to recall someone asking about that a while ago. Maybe this should be F:set-variable instead of U:set-variable but I am not confident that it couldn't be done in a better way so for the time being I keep it in my personal library. Comments of course are welcome. Michael Downes mjd@math.ams.org (Internet) >From freemacs-workers-request@sun.soe.clarkson.edu Thu, Jan 14 21:45:23 EST 1993 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Thu, 14 Jan 1993 21:45:23 EST Received: from barnacle.erc.clarkson.edu by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA09447; Thu, 14 Jan 93 18:03:33 -0500 Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <22651-0@barnacle.erc.clarkson.edu>; Thu, 14 Jan 1993 18:05:41 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA01142; Thu, 14 Jan 93 17:08:59 EST Return-Path: Received: from math.ams.org (MATH.AMS.COM) by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA01132; Thu, 14 Jan 93 17:08:39 EST Received: from MATH.AMS.ORG by MATH.AMS.ORG (PMDF #2306 ) id <01GTILQRF1J4F5N4M8@MATH.AMS.ORG>; Thu, 14 Jan 1993 17:09:11 EST Date: 14 Jan 1993 17:09:10 -0500 (EST) From: MJD@MATH.AMS.ORG Subject: mjd-m.min To: freemacs-workers@sun.soe.clarkson.edu Message-Id: <01GTILQRFB6AF5N4M8@MATH.AMS.ORG> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT [*]#(ds,M-comment-string,;##(bc,##(bc,;),d,a))#(ds,Mmodified)[*] ;; M-comment-string is defined here in order to pre-expand it, ;; rather than in an ordinary function definition below. ;; [Michael Downes,14-Jan-1993] In order to make sense of the functions defined in this file you need to know the canonical form that Mint code has had (as designed by Russ Nelson): Each function begins with "Name:" + library-letter + function-name + newline, then continues with a documentation section of arbitrary length, then ends with the function body, marked before and after by the special string "[* ]". The primary purpose of the documentation section (or, at least, an important purpose that the knowledgeable Mint programmer bears in mind) is to serve as on-call help for, e.g., the key sequence Help-f (describe-function). To make this documentation easily accessible for Freemacs, all the documentation pieces are compiled into .edd files on a per-library basis, and Freemacs goes to the appropriate .edd file when it needs to look up any documentation. Comments in Mint code are simple: everything outside of the function body, and outside of the "Name:" line, is a comment. There is no comment facility as such, like the ";" in assembly language, or the "(*" ... "*)" in C. In fact this rather makes sense, given the design of the Mint language that treats essentially all characters as executable code. The one feature that comes close to providing commentability is the fact that extra arguments beyond the ones defined for a function are ignored. Thus the conventional no-op function #(..), which takes no arguments, treats any arguments that may be given to it as comments. But only in a sense, because the comment string and the no-op function remain embedded in the function code after compiling, and are scanned every time the function is called. Given the speed of Freemacs, this doesn't significantly hurt execution time if comments are sparse, and are judiciously excluded from high-iteration loops. The size of the compiled code, however, also reflects the embedded comments, so that a large number of comments might have an unpleasant bloating effect on the .ed files. These restrictions on comments put a bit of a crimp in my programming style, which normally includes liberal comments in the middle of the code. The functions defined below are designed to support comments in the middle of a function body. The default comment prefix is ";;" (double semicolon): everything following an instance of ;; up to the end of the line is removed from the function body before it is compiled. Any tab characters immediately preceding the ;; are also removed, so that comments can be vertically aligned, asm style, if desired. One other feature that I'm fond of in other programming environments, and that I missed in Mint, was the ability to compile just the function in which the cursor happens to be located at the moment. It would have been possible to make a function that called Mstrings-read-do, but Mstrings-read-do assumes the cursor position is in the "Name:" line of the function that you want to compile, and I wanted a more ambitious function that would look around for the nearest "Name:" line, scan for the function body associated with that declaration, and compile the function if it turns out that the cursor position is anywhere inside the function, between the "N" in "Name:" and the "]" in the final "[ * ]". Furthermore, if the current point turned out to be not inside a function definition, I wanted the smart function to look further in the current buffer for a function definition and, upon finding one, highlight the "Name" line and ask whether this function should be compiled. These two features---comments in the function body, and individual compiling of functions---are what dictated the design of the functions in this file. Here's the approach: To compile a whole buffer, we first copy its contents into a scratch buffer, then remove all comments, then start at the beginning and apply #(ds) to each function. When compiling just a single function, we still copy it into the scratch buffer, but now we have to do some preliminary searching in the base buffer to find the beginning and end of the function that is to be compiled, before we can copy it into the scratch buffer. The fact that all comments anywhere in the scratch buffer are removed before any functions are compiled has the following side effect: In the documentation part (between the "Name:" line and the first "[* ]"), any text that is commented out will not be copied into the .ed file for on-line help. Thus you can use noncommented text to document the function for the user, and commented text to elucidate technical details for yourself or other programmers. Note: Unlike Mstrings-read, M:eval-buffer will find and compile a function even when the "Name:" line is the very first line of the current buffer. Function descriptions: M:eval-defun looks to see if the cursor is inside a valid function structure as described above, where `inside' is true if the cursor is on the `N' in Name:, or at the end of the line containing the final `[* ]', or anywhere in between. If inside a function, that function is copied into a scratch buffer, all comments are removed, and the function is compiled/evaluated/ds'd. If the cursor is *not* inside a function, then Freemacs will look for the nearest function structure it can find (preferring forward direction), and if it finds one, it will highlight the first line and ask if you want to compile that function. M:eval-buffer is similar to M:done-editing but internally behaves like M:eval-defun with respect to comments, scratch-buffer, etc. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Nxame:M-comment-string This is defined above in order to make the contents fully expanded to two semicolons and without any embedded tab character, in order to easily use it in #(lp) via ##(M-comment-string). "Name:" was changed to "Nxame:" since it would be redundantly pointless to execute this version of the definition. The conventional way of defining this would have been something like: [*]; ;[*] Name:M-function-start Regexp for the string that marks the beginning of function code. [*]^\[\*][*] Name:M-function-end Regexp for the string that marks the end of function code. Unlike M-function-start, this does not have to fall at the beginning of a line. [*]\[\*][*] Name:Mgo-to-nearest-function This function must scan the beginning and end of the current function by searching backward for function declaration ('Name:'), forward for start of function code (Mstrings-delimiter) and then forward more for end of code. If a valid-seeming function is found, execute arg1, otherwise arg2. Because of the way #(l?) works we should do a bit of backing and filling before we start looking for the function declaration, just in case the cursor happens to be initially in the middle of the 'Name:' string. The least number of characters between Name: and end of buffer is at least 12, in order for it to be a meaningful function definition. (Name: + one character + [ * ] + [ * ]) [*]#(pm,3) #(g?,##(rc,]),12,(#(sp,>>>>>))) #(lp,^Name:,,r) #(l?,.,[,1,2,( #(sp,2) #(lp,#(M-function-start),,r) #(l?,.,],,2,( #(sp,2) #(lp,#(M-function-end),,r) #(l?,.,],,2,( #(sp,2$)#(sm,2) #(sp,0) #(mb,2,( #(Mfind-function-forward,(arg1),(arg2)) ),( #(sp,2) arg1#(sp,2>)#(pm) )) ),( #(sp,0)#(pm)arg2 )) ),( #(sp,0)#(pm)arg2 )) ),( #(sp,0) #(Mfind-function-forward,(arg1),(arg2)) )) [*] Name:Mfind-function-forward Assumptions: current point is at mark 0, and the first instance of "Name:" in the reverse direction is for a function that does not include current point, therefore we need to look in forward direction. [*]#(lp,^Name:,,r) #(l?,.,],1,2,( #(sp,2) #(lp,#(M-function-start),,r) #(l?,.,],,2,( #(sp,2) #(lp,#(M-function-end),,r) #(l?,.,],,2,( #(sp,2$)#(sm,2) arg1#(sp,2>)#(pm) ),( #(sp,0)#(pm)arg2 )) ),( #(sp,0)#(pm)arg2 )) ),( #(sp,0)#(pm)arg2 )) [*] Name:M:eval-defun [*] #(Mgo-to-nearest-function,( #(Minside-function?,( #(Meval-defun,##(ba,-1)) ),( #(sp,1) #(sv,im,$)#(rd) #(Fprompt-with-default,Compile this function?,y,n,( #(==,ARG1,y,(#(Meval-defun,##(ba,-1)))) )) #(sv,im,.) )) ),( #(Ferror,Can't find any function to compile) )) [*] Name:Minside-function? Returns arg1 if the original cursor position falls inside the marks set by Mgo-to-nearest-function. Otherwise arg2. ASSUMPTION: Current point is at mark 2, located at the end of the last line of the function body. [*]#(mb,0,( #(sp,0>) #(mb,1,(arg1),(arg2)) ),( arg2 )) [*] Name:Meval-defun Args:(home-buffer,exit-code) ;; When Meval-defun is called, it assumes that marks are placed as ;; follows (using <1> to show the location of mark 1, and so forth) ;; ;; <1>Name:Ffunction-name ;; ... ;; [ * ]... ;; ... ;; [ * ]... <2> ;; ;; The text between the final [ * ] and <2> is usually, but not ;; necessarily, null (there might conceivably be a comment there). ;; <2> is placed at the end of the line. Mark 0 is left at the ;; original starting position when M:eval-defun was called. ;; "Home-buffer" is the number of the current buffer, for returning ;; here later via #(Fkill-buffer). "Exit-code" is code to be ;; executed when the recursion terminates. [*]#(sp,1) #(Ffind-or-make-buffer,*m-w-b*) #(sp,[)#(dm,]) #(bi,home-buffer,2) #(Mdelete-all-comments) #(sp,[) #(SELF-do) exit-code #(ds,last-buffer,@##(buffer-number.home-buffer)(,)##(last-buffer)) #(Fkill-buffer) #(sp,0) [*] Name:Mmark-up-function [*]#(lp,^Name:,,r) #(pm,5) #(l?,.,],,0,( #(sp,0) #(lp,#(M-function-start),,r) #(l?,.,],,1,( #(sp,1) #(lp,#(M-function-end),,r) #(l?,.,],2,3,( #(sp,0) arg1 )) )) )) #(pm) [*] Name:Meval-defun-do Mmark-up-function is similar to Mgo-to-nearest-function but due to preliminary processing we know that we will always find a function following the current point. [*]#(Mmark-up-function,( #(SELF-do,##(rm,>),##(rm,$)) #(sp,3$) #(SELF) )) [*] Name:Meval-defun-do-do This is called with marks assumed set as follows: -----Name:<0>Ffunction-name -----... -----[ *]<1> -----.... -----<2>[ *]...<3> The first piece of business that needs to be taken care of is looking for a possible "Args:(...)" specification of named arguments. If one is found, then we use the given argument names instead of the standard names arg1, arg2, .... In either case we pass everything on to SELF-do in order to get the argument list nicely expanded for further use. [*]#(an,[Reading arg2]) #(lp,^Args:##(bc,40,d,a),,r) #(l?,.,1,,4,( #(sp,4) #(lp,##(bc,41,d,a)) #(l?,.,1,4,,( #(SELF-do,arg1,arg2,SEL(F,)##(rm,4)) ),( #(Ferror,Problem with "Args:" list) )) ),( #(SELF-do,arg1,arg2,##(Farglist)) )) [*] Name:Meval-defun-do-do-do Arg1 = lib letter (first letter of function name) Arg2 = full function name Arg3 = list of arguments ;; ;; The storing of the documentation still needs to be worked on. ;; 6-Jan-1993 mjd [*] #(Fand,(Fand,(Fisupper,##(bc,arg1)),(==,#(arg1filename),,)),(!=,arg2,arg1filename,,),( #(Ferror,arg1filename unknown) ),( #(mp,lib-list,,arg1) #(ds,lib-list,arg1##(lib-list)) )) #(sp,1) #(ds,temp,##(rm,2)) #(==,##(temp),***,( #(n?,arg2,( #(es,arg2) #(Fisupper,##(bc,arg1),(#(ds,arg1modified))) )) ),( #(ds,arg2,##(temp)) #(mp,arg2,arg3) #(Fisupper,##(bc,arg1),(#(ds,arg1modified))) )) #(sp,1)#(sm,1,^) #(sp,0$>) #(ds,documentation,##(rm,1)) #(Fisupper,##(bc,arg1),( #(Mstore-documentation,arg1,arg2) )) [*] Name:Mdelete-all-comments Remove all comments in the current buffer. ;; Note that in the look pattern M-comment-string is called in ;; active mode, in order to resolve anything like ##(bc,n,d,a) that ;; it might contain. [*]#(sp,[) #(pm,1) #(lp,##(bc,9,d,a)*#(M-comment-string).*$,,r) #(SELF-do) #(pm)[*] Name:Mdelete-all-comments-do [*]#(l?,.,],0,,(#(sp,0$>)#(dm,0)#(SELF)))[*] Name:M:eval-buffer Compile all the functions found in the current buffer. ;; Meval-defun copies the region between marks 1 and 2 into a scratch ;; buffer, then starts at the beginning and recursively compiles ;; functions until it reaches the last compilable function; then it ;; kills the scratch buffer and returns to the base buffer. [*]#(pm,3) #(sm,1,[) #(sm,2,]) #(Meval-defun,##(ba,-1),(#(Mexecute-top-code))) #(pm) [*] Name:Mexecute-top-code ;; This function assumes that the current buffer is the scratch ;; buffer where functions are compiled [*]#(sp,[) #(Flooking-at,\[\*\],( #(sp,>>>) #(lp,#(Mstrings-delimiter)) #(l?,.,],0,,( #(ow,##(rm,0)) #(ow,( ---------------------------------------------------------------------- )) #(Fprompt-with-default,Execute this MINT code,y,n,( #(==,ARG1,y,( #(rm,0) )) )) )) ))[*] Name:Min-documentation Locate the documentation for the function arg2 in the library arg1. Execute arg3 if the documentation exists [with point just before the string-delimiter, and mark 0 just after the Name:xxx], otherwise execute arg4 if the documentation doesn't exist. ;; mjd: Modified 1993-Jan-7 to use regexp ^Name:xxx$ as the look ;; pattern instead of just Name:xxx. This prevents accidental ;; mismatching with a function name that is a superset of the name ;; being looked for. [*]#(ds,old-buffer,##(ba,-1)) #(n?,buffer-name.##(arg1filename).edd,( #(..,#(ba,##(buffer-name.##(arg1filename).edd))) ),( #(ds,value,##(env.EMACS)##(arg1filename).edd) #(Ffind-buffer,##(arg1filename).edd,,,( #(Ffind-unused-buffer,##(value)) #(==,##(ff,##(value)),,( #(Fbuffer-set-fn,##(value)) ),( #(Fvisit-do) )) #(Fremember-buffer,bury) )) )) #(lp,^Name:arg2$,,r) #(pm,1) #(l?,[,],,0,( #(sp,0>) #(lp,#(Mstrings-delimiter)) #(l?,.,],0) arg3 ),( arg4 )) #(pm) #(..,#(ba,##(old-buffer))) [*] Name:Mstore-documentation Args:(library-letter,full-function-name) ;; Min-documentation executes arg3 if documentation for ;; full-function-name is found in the .edd file corresponding to ;; the given library. Otherwise arg4. If documentation was found, ;; mark 0 is left at the beginning of the doc-text (after the ;; "Name:" line) and the point is left at the end of the doc-text ;; (just before Mstrings-delimiter. [*]#(Min-documentation,library-letter,full-function-name,( #(==,##(documentation),,( #(dm,0)#(dm,$)#(dm,<)#(dm,^)#(dm,<)#(dm,>) ),( #(dm,0) #(is,##(documentation)) )) ),( #(==,##(documentation),,,( #(sp,]) #(Fcrlf)#(sm,0,<) #(is,Name:full-function-name)#(Fcrlf) #(is,##(documentation)#(Mstrings-delimiter)) #(Fcrlf) )) )) #(es,documentation) [*] >From freemacs-workers-request@sun.soe.clarkson.edu Thu, Jan 14 21:45:17 EST 1993 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Thu, 14 Jan 1993 21:45:17 EST Received: from barnacle.erc.clarkson.edu by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA09260; Thu, 14 Jan 93 18:01:55 -0500 Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <22641-0@barnacle.erc.clarkson.edu>; Thu, 14 Jan 1993 18:05:30 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA01131; Thu, 14 Jan 93 17:08:27 EST Return-Path: Received: from math.ams.org (MATH.AMS.COM) by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA01120; Thu, 14 Jan 93 17:08:18 EST Received: from MATH.AMS.ORG by MATH.AMS.ORG (PMDF #2306 ) id <01GTILQI58QOF5N4M8@MATH.AMS.ORG>; Thu, 14 Jan 1993 17:08:58 EST Date: 14 Jan 1993 17:08:57 -0500 (EST) From: MJD@MATH.AMS.ORG Subject: mjd-f.min To: freemacs-workers@sun.soe.clarkson.edu Message-Id: <01GTILQI58QQF5N4M8@MATH.AMS.ORG> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT [*]#(ds,Fmodified)[*] ;; Functions in this file provide the following features. ;; ;; ---Fy-or-n accepts lowercase or uppercase yYnN equally (so if you ;; accidentally hit Caps Lock Freemacs will still understand you ;; when prompting for y or n answer). This is important because ;; otherwise your answer is likely to vanish off screen before you ;; have time to notice that it is cap instead of lowercase. ;; ;; ---Fprompt-with-default allows you to put up a prompt like ;; ;; Do you want to compile this function? [y] ;; ;; and interpret y, Y, or as a yes answer, with anything ;; else being interpreted as a no answer. The syntax is sort of ;; peculiar (see the example in the function's documentation ;; section) so suggestions for improving it are welcome. ;; ;; ---Flowercase and Fuppercase are support functions for Fy-or-n ;; and Fprompt-with-default that change the case of a string held in ;; memory instead of in a buffer. (Otherwise you would have to write ;; the user's answer into a buffer, change the case there, then ;; reread it.) ;; ;; ---Fautosave. I think someone asked about this a while ago, but I ;; don't recall now the details of setting it up. If you can figure ;; out how to use it, fine, otherwise send me mail and I'll ;; investigate. ;; ;; Michael Downes 14-Jan-1993 Name:Flowercase Lowercase a string, returning the lowercased version as the result. This is not perfectly robust and may not always be exactly what is wanted: if arg1 contains unmatched parentheses, bad things can happen. And the return value is inactive, rather than active, because of arg1 being enclosed in parentheses. [*]#(ds,-SELF,(arg1)) #(SELF-do) #(es,-SELF) [*] Name:Flowercase-do This is called recursively to go through the list of characters and translate them one by one using #(si). [*]#(ds,-SELF,##(si,Fxlat-lower,##(go,-Flowercase,done))) #(==,##(-SELF),done,( #(es,-SELF) ),( ##(-SELF) #(SELF) )) [*] Name:Fuppercase Uppercase a string, returning the uppercased version as the result. [*]#(ds,-SELF,(arg1)) #(SELF-do) #(es,-SELF) [*] Name:Fuppercase-do [*]#(ds,-SELF,##(si,Fxlat-upper,##(go,-Fuppercase,DONE))) #(==,##(-SELF),DONE,( #(es,-SELF) ),( ##(-SELF) #(SELF) )) [*] 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. Modified to accept Y or N also, 20-Dec-1992 mjd. [*]#(an,arg1 ((y/n)) ) #(Fcase,#(g)#(an), (y,(#(Fr,(arg2),y))), (n,(#(Fr,(arg2),n))), (Y,(#(Fr,(arg2),y))), (N,(#(Fr,(arg2),n))), (C-g,()), ( #(Fflush-input-buffer) #(SELF,(arg1),(arg2)) ) )[*] Name:Fprompt-with-default This is like Fy-or-n but defaults to arg3 if the user enters anything but (upper or lowercase) arg2 or plain . Arg4 should use ARG1 to access the passed value of arg2 or arg3 (see the definition of #(Fr)). For example: #(Fprompt-with-default,Do you want shishkebab,y,n,( #(==,ARG1,y,( #(an,YOU GOT shishkebab) ),( #(an,YOU GOT pizza) )) )) [*]#(an,arg1 [arg2]: ) #(Fcase,#(g)#(an), (#(Flowercase,arg3),(#(Fr,(arg4),arg3))), (#(Fuppercase,arg3),(#(Fr,(arg4),arg3))), (C-g,()), ( #(Fr,(arg4),arg2) ) )[*] Name:Fauto-save Same as F:save-buffers-kill-emacs but doesn't kill. [*]#(ds,unsaved-buffers)#(ds,start-buf,##(ba,-1)) #(Fmaybe-write-abbrevs,( #(==,#(Flist-all-strings,modified),,( #(Ftrash-buffer,2) ),( #(Fprompt-with-default,Editor modified - save it?,y,n,( #(Ftrash-buffer,2,##(start-buf),( #(==,ARG1,y,( #(F:save-all-libs) ),( #(ds,unsaved-buffers,##(unsaved-buffers)n) )) )) )) )) )) #(..,##(ba,#(start-buf))) [*] >From freemacs-workers-request@sun.soe.clarkson.edu Thu, Jan 14 21:45:11 EST 1993 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Thu, 14 Jan 1993 21:45:11 EST Received: from barnacle.erc.clarkson.edu by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) id AA09184; Thu, 14 Jan 93 18:01:08 -0500 Received: from sun.soe.clarkson.edu by barnacle.erc.clarkson.edu with SMTP (PP) id <22635-0@barnacle.erc.clarkson.edu>; Thu, 14 Jan 1993 18:05:15 -0500 Received: by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA01146; Thu, 14 Jan 93 17:09:00 EST Return-Path: Received: from math.ams.org (MATH.AMS.COM) by sun.soe.clarkson.edu (4.1/SMI-4.1) id AA01134; Thu, 14 Jan 93 17:08:48 EST Received: from MATH.AMS.ORG by MATH.AMS.ORG (PMDF #2306 ) id <01GTILR1VHSWF5N4M8@MATH.AMS.ORG>; Thu, 14 Jan 1993 17:09:24 EST Date: 14 Jan 1993 17:09:24 -0500 (EST) From: MJD@MATH.AMS.ORG Subject: mjd-u.min To: freemacs-workers@sun.soe.clarkson.edu Message-Id: <01GTILR1VHSYF5N4M8@MATH.AMS.ORG> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT [*]#(ds,Umodified)[*] ;; Some of the functions in this file include ";;" comments in the ;; function body---if your version of done-editing can't handle ;; them, try using my functions M:eval-defun or M:eval-buffer. ;; [mjd,14-Jan-1993] Name:Utime Times a function given as arg1. Only accurate to the nearest couple of seconds. Normal usage (for me) is to write a line like #(Utime,(#(foobar,arg))) then hit F2 (F:try-it). [*]#(ds,temp,##(ct))#(..,##(gn,temp,11)) #(ds,startin-time,##(gn,temp,8)) #(an,Start: ##(startin-time)...) arg1#(ds,temp,##(ct))#(..,##(gn,temp,11)) #(ds,endin-time,##(gn,temp,8)) #(ds,elapsed-time,#(Usubtract-times,##(endin-time),##(startin-time))) #(an,Start: ##(startin-time) End: ##(endin-time) Elapsed: ##(elapsed-time)) [*] Name:Usubtract-times Takes 2 args in the form hh:mm:ss (hours, minutes, seconds). Returns arg1 - arg2, in the same form, or 00:00:00 and error message if arg1 is less than arg2. [*]#(ds,first-time,arg1)#(ds,second-time,arg2) #(ds,hours,##(--,##(gn,first-time,2),##(gn,second-time,2))) #(..,##(gn,first-time,1)##(gn,second-time,1)) #(ds,mins,##(--,##(gn,first-time,2),##(gn,second-time,2))) #(..,##(gn,first-time,1)##(gn,second-time,1)) #(ds,secs,##(--,##(gn,first-time,2),##(gn,second-time,2))) #(g?,##(secs),-1,,( #(ds,mins,##(--,##(mins),1))#(ds,secs,##(++,##(secs),60)) )) #(g?,##(mins),-1,,( #(ds,hours,##(--,##(hours),1))#(ds,mins,##(++,##(mins),60)) )) #(g?,##(hours),-1,,( #(Ferror,Tried to subtract a larger time from a smaller one) )) #(Utwo-digits,##(hours)): #(Utwo-digits,##(mins)): #(Utwo-digits,##(secs)) [*] Name:Utwo-digits [*]#(g?,arg1,9,,0)arg1[*] Name:Uset-variable [*]#(ds,variable,arg1) #(ds,value,##(arg1)) #(Freadline,Set arg1 = ,( #(ds,arg1,##(value)) #(ds,##(go,variable)modified) #(Fset-variables) )) #(es,variable) [*] Name:U:set-variable Function to allow setting of individual variables. Show the current value prompt for a replacement. ;; This is usually more convenient than F:edit-options which edits ;; the whole set. [*]#(rs,value) ;; If the first letter of previous function name is a library ;; letter, then do nothing, otherwise null-out value. #(fm,##(lib-list),#(go,value,((?))),(#(ds,value))) ;; If the second letter of value is "-" then do nothing, else ;; null-out value. #(==,#(go,value),-,,(#(ds,value))) #(..,##(value)) #(Fcompleting-readline,Variable: ,( #(Fresolve-name,##(value),( #(Uset-variable,##(temp)) ),-) ),( #(Fmultiple,(Fdelete-n-chars,2),#(Flist-all-strings,-##(value)##(2nd-half)),U:set-variable) ),-)[*] >From km@vivitech.com Tue, Jun 29 10:57:18 EDT 1993 Received: from uupsi3 by crynwr.com (UUPC/extended 1.11q) with UUCP; Tue, 29 Jun 1993 10:57:18 EDT Received: by uu3.psi.com (5.65b/4.0.071791-PSI/PSINet) via UUCP; id AA21322 for ; Tue, 29 Jun 93 09:40:07 -0400 Date: Tue, 29 Jun 93 08:38:22 EDT From: km@vivitech.com (Keith McLelland) Received: by vivitech.com (4.1/3.2.012693-Vivid Technologies Inc.); id AA13982 for crynwr.com!nelson; Tue, 29 Jun 93 08:38:22 EDT Message-Id: <9306291238.AA13982@vivitech.com> To: nelson@crynwr.com Hi Russ, Thank you for letting me know how to get Freemacs 1.6d. Whatever the problem was with 1.6a and illegal instructions, it is indeed solved in 1.6d. I also see that you and others have made some nice improvements in 1.6d. Over the years I have accumulated some improvements myself as I mentioned before. This seems like a good time to send them along. I can understand your problems with time to hack at Freemacs, but I guess you are the person to send this kind of information to in hopes it will get to the people who are in position to do the work. I'm trusting that Email will send reliably (I'm new at it, having just started at this job where it exists) and am sending MINT code in the note. First some genuine bugs: ** One that was introduced into 1.6d is a "`" where an "a" belongs in read-tab-stop-list-do. Here is the corrected function (although the problem will leap out at you when you look at the bad one): Name:Fread-tab-stop-list-do [*] #(l?,.,$,0,,( #(sp,0) #(ds,F-tab-stop-list,##(F-tab-stop-list)##(lv,cs)(,)) #(sp,>) #(SELF) )) [*] ** Scroll-up-other-window doesn't do what it says; I tried fixing it and ended up with no change in behavior. ** Another that I had fixed before but is still in 1.6d is in the move-to-window-line function. Yours doesn't do the right thing and furthermore doesn't even do the same thing in the top and bottom windows. Here is one that works: Name:F:move-to-window-line Move point to left margin on the line halfway down the screen or window. Text does not move on the screen. A numeric argument says how many screen lines down from the top of the window (zero for the top). A negative argument from the bottom (-1 for the bottom). [*] #(ds,temp, #(sv,cl,##(++,##(--,##(lv,cl),##(lv,rs)), #(==,arg1,,##(++,##(//,##(--,##(lv,bl),##(lv,tl)),2), ##(--,##(lv,tl),1)), ##(++,arg1,#(g?,0,arg1,##(++,##(lv,bl),1),##(lv,tl))) )))) [*] ** A bug that persists is that parentheses cannot be found; apparently it gets too excited about their special MINT uses. This, of course, is probably in the C code not the MINT. Don't understand why this doesn't drive everyone as nuts as it drives me. ** A related problem: parentheses in C code gum up the indentation. In particular they are particularly nasty at the beginning (e.g. a left-side cast). ** A question for C mode: How do you convince it to use no tabs, only spaces when indenting in this mode? It used to do this and coworkers who use other editors will not be pleased that my C has tabs where theirs doesn't. ** While discussing C: The mouse used to fail to select in this mode; no longer has the problem. But I think it is supposed to be able to select comments and it does not do that. A bug?? ** A potential bug: When it says "[More?]" it does not accept any character that means "NO". ** auto-match-paren is very nice but I have two complaints. 1. How do you turn it off; it seems to be a sorcerer's apprentice; 2. when bottom-percent is small and the cursor moves to the bottom line you get strange behavior in which the next line appears invisibly (right arrow or anything that moves from the edge makes all right). ** From here down are my additions. First is a set of functions like move-to-window-line that allow quick motion around a window: Name:F:move-to-window-bottom Move point to left margin on the bottom line on the screen or window plus the number of lines in the argument. [*] #(ds,temp, #(sv,cl,##(--,##(++,##(--,##(lv,cl),##(lv,rs)),##(++,##(lv,bl),1)),arg1)) ) [*] Name:F:move-to-window-center Move point to left margin on the line halfway down the screen or window plus the number of lines in the argument. [*] #(ds,temp, #(sv,cl,##(++,arg1,##(++,##(--,##(lv,cl),##(lv,rs)), ##(++,##(//,##(--,##(lv,bl),##(lv,tl)),2),##(--,##(lv,tl),1)) )))) [*] Name:F:move-to-window-top Move point to left margin on the top line on the screen or window plus the number of lines in the argument. [*] #(ds,temp, #(sv,cl,##(++,arg1,##(++,##(--,##(lv,cl),##(lv,rs)),##(lv,tl)))) ) [*] Name:F:slide-n-downwards Move the window upwards across a stationary cursor. Default move is 1/3 window; 0 or negative cause no action or motion the other way. [*] #(ds,temp,#(Fslide-either-up-down, #(==,arg1,,##(//,##(--,##(lv,tl),##(lv,bl)),3),##(--,0,arg1)))) [*] Name:F:slide-n-upwards Move the window downwards across a stationary cursor. Default move is 1/3 window; 0 or negative cause no action or motion the other way. [*] #(ds,temp,#(Fslide-either-up-down, #(==,arg1,,##(//,##(--,##(lv,bl),##(lv,tl)),3),arg1))) [*] Name:Fslide-either-up-down [*] #(ds,temp,##(lv,rs)) #(sv,cl,##(++,##(lv,cl),arg1) #(sv,rs,##(temp)) [*] ** Here is my whole searching suite. Incremental searching is not my bag and I hate it when I cannot recover what I searched with before. This collection of functions does it all very nicely. I've given my mode line at the end to show how I display the regexp/case-insens stuff. I bind the two "generals", the "again", the "other way", and the "adjustments" to keys. I should some day make the adjustments apply to replacements but never have done so. Name:F:search-adjustments Interactive adjustment of whether searches are regexp or not and case-sensitive or not. [*] #(Fy-or-n,Regular expression search?,(#(ds,is.regexp,(ARG1)))) #(==,##(is.regexp),y,(#(ds,is.regexp,R)),(#(ds,is.regexp,))) #(Fy-or-n,Fold case while searching?,(#(ds,is.case-insens,(ARG1)))) #(==,##(is.case-insens),y,(#(ds,is.case-insens,F)),(#(ds,is.case-insens,))) [*] Name:F:search-again This does another instance of whichever search was last conducted from the set: F:search-{for,back}ward[-regexp]. Search-other-way is similar except that it reverses the direction. [*]#(n?,is.backward,( #(lp,##(is.search-for),(#(Fmessage,(##(is.search-for) not RE))), ##(is.regexp),##(is.case-insens)) #(pm,1) #(l?,.,[,0,,( #(sp,0) ),( #(Fmessage,(##(is.search-for) not found)) )) #(pm) ),( #(lp,##(is.search-for),(#(Fmessage,(##(is.search-for) not RE))), ##(is.regexp),##(is.case-insens)) #(pm,1) #(l?,.,],,0,( #(sp,0) ),( #(Fmessage,(##(is.search-for) not found)) )) #(pm) ))[*] Name:F:search-backward [*]#(Finsist,(arg1),SELF,( #(lp,(arg1)) #(pm,1) #(ds,is.backward) #(l?,.,[,0,,( #(sp,0) ),( #(Fmessage,(arg1 not found)) )) #(pm) ))[*] Name:F:search-backward-general [*]#(Finsist,(arg1),SELF,( #(ds,is.search-for,(arg1)) #(lp,(arg1),(#(Fmessage,(arg1 not RE))), ##(is.regexp),##(is.case-insens)) #(pm,1) #(ds,is.backward) #(l?,.,[,0,,( #(sp,0) ),( #(Fmessage,(arg1 not found)) )) #(pm) ))[*] Name:F:search-backward-regexp [*]#(Finsist,(arg1),SELF,( #(lp,(arg1),(#(Fmessage,(arg1 not RE))),R,C) #(pm,1) #(ds,is.backward) #(l?,.,[,0,,( #(sp,0) ),( #(Fmessage,(arg1 not found)) )) #(pm) ))[*] Name:F:search-forward [*]#(Finsist,(arg1),SELF,( #(lp,(arg1)) #(pm,1) #(es,is.backward) #(l?,.,],,0,( #(sp,0) ),( #(Fmessage,(arg1 not found)) )) #(pm) ))[*] Name:F:search-forward-general [*]#(Finsist,(arg1),SELF,( #(ds,is.search-for,(arg1)) #(lp,(arg1),(#(Fmessage,(arg1 not RE))), ##(is.regexp),##(is.case-insens)) #(pm,1) #(es,is.backward) #(l?,.,],,0,( #(sp,0) ),( #(Fmessage,(arg1 not found)) )) #(pm) ))[*] Name:F:search-forward-regexp [*]#(Finsist,(arg1),SELF,( #(lp,(arg1),(#(Fmessage,(arg1 not RE))),R,C) #(pm,1) #(es,is.backward) #(l?,.,],,0,( #(sp,0) ),( #(Fmessage,(arg1 not found)) )) #(pm) ))[*] Name:F:search-other-way This does another instance of whichever search was last conducted from the set: F:search-{for,back}ward[-regexp] except that the direction is reversed. Search-again is similar except that it uses the same direction. [*]#(n?,is.backward,( #(es,is.backward) #(F:search-again) ),( #(ds,is.backward) #(F:search-again) ))[*] Name:is.case-insens [*]F[*] Name:is.regexp [*]R[*] Name:Fmode-line This shows us where we are and what we're doing. [*]#(sv,fc,#(F-mode-fore-color)) #(sv,bc,#(F-mode-back-color)) #(an, - #(Fbuffer-modified,**,--,%%) - Emacs: #(buffer-number.##(ba,-1)) ##(Fmode-parens,##(buffer-mode.##(ba,-1))#(mode-line-mode) ##(minor-modes.##(ba,-1))#(n?,kbd-macro-d, Def)) -##(is.regexp)##(is.case-insens)- C#(lv,cs) L#(lv,cl)/#(lv,nl) -- #(Fwhere) --------------------------------------------------------- ,a ) #(sv,fc,#(F-fore-color)) #(sv,bc,#(F-back-color)) [*] ** This is a little function pair that is quite useful: Name:F:backward-kill-line [*] #(Fkill-do,Fbackward-kill-line,(arg1),backward-) [*] Name:Fbackward-kill-line Move to the beginning of the current line. [*]#(==,arg1,,( #(==,##(rm,<),( ),( #(sp,<) ),( #(sp,^) )) ),( #(sp,^#(Floop,#(Fsignum,(arg1),<^,$>),#(Fmodulus,(arg1)))) ))[*] Thanks, keep up the good work. I can't volunteer to do a lot of freemacs hacking, but would always be happy to test stuff, critique ideas, improve documentation, and that sort of thing. Put me on your emailing list. Keith