From owner-aurora-editor@sfu.ca Fri May 2 00:41:26 1997 From: Glenn Singgalang Tarigan Message-Id: <199705020419.VAA22418@fraser> Subject: =AML= Macro: opening files To: aurora-editor@sfu.ca (Aurora Mailing List), tarigan@sfu.ca (Glenn Tarigan) Date: Thu, 1 May 1997 21:19:31 -0700 (PDT) X-Mailer: ELM [version 2.4 PL24] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Another macro tidbit: There are files that I load up very frequently, so I needed a quick way to access them. The following macro will open up a regular open prompt, but if you type in a predefined file-abbreviation, it will load that file. It needs fewer keystrokes than filename completion or template expansion. For example: at the "open" prompt-box, if I type "k" and press , instead of opening "c:\k" it opens "c:\a3\kbd.aml". Here it is: (put it in KBD.AML, under object edit_fmgr) {--BEGIN--------------------------} key // open prompt file = ask "[file/ibcenz] Open" "_load" if file then if not (poschar '-^$.[]?|*+@#{}:\~' file) then // skip abbreviation checking if a wildcard is given if loadbuf 'd:\\w\\editlist.txt' then // list of abbreviations if find '^' + file + ' ' 'xgi' then find ' [~ ]' 'x' // go to next string on line file = gettext (getcol) (getlinelen + 1 - getcol) end destroybuf end end open file // maxfurther Removed as per Glenn's advice in a later posting end {--END----------------------------} The abbreviation file has to be in this format: abbreviation + + full pathname The abbreviations can be an alphanumeric string as big as you like. To reduce my typing burden, I chose one or two character abbreviations. Here's an example of my own 'd:\\w\\editlist.txt' : (You can change 'd:\\w\\editlist.txt' to a different name if you want.) {--BEGIN--------------------------} a2 c:\a21\ a c:\a3\ d c:\a3\doc\ f c:\a3\doc\function.dox k c:\a3\kbd.aml m c:\a3\macro\ st c:\a3\macro\status-.aml s c:\a3\syn j c:\junk\ v c:\m\vidtapes.- w d:\w\ e d:\w\editlist.txt {--END----------------------------} Glenn -- HP200LX EO P=X MI -- 1997.05.01 2109.50 PST PGP 0xB7764059 777bits 1D 3C 6B F9 B2 47 2A 12 48 D7 18 56 17 7F 80 8C