Message-Id: <3.0.1.16.19970909220535.2f3f5e6c@popd.ix.netcom.com> X-Sender: jawilson@popd.ix.netcom.com (Unverified) X-Mailer: Windows Eudora Light Version 3.0.1 (16) Date: Tue, 09 Sep 1997 22:05:35 To: aurora-editor@sfu.ca From: Jim Wilson Subject: 'filelist' macro Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Here's a couple of macros someone may find useful... I've never liked the 'filelist' function, primarily because it always listed the subdirectory name before the file name. If I've got more than one file loaded from a given directory -- not a terribly uncommon occurrence -- than I had to use the arrow keys to highlight the one I wanted to select. I would much prefer to just type the first few letters of the _file_ name and have it be selected. Now, I can. The two macros, lstfile1 and lstfile2, are variations of the same concept; they both display the name of every loaded file. The only difference being that lstfile2 also displays the subdirectory of the file, albeit _after_ the file name. Done this way, I can now type just a couple of letters and have the file in question be immediately highlighted. Once done, hitting selects the file. Now, if I can only figure out how to do the same thing with the history lists... /* ------------------------------------------------------------------ */ /* Macro: LSTFILE1.AML */ /* Written by: Jim Wilson */ /* */ /* Description: Macro used to display a list of files being edited */ /* WITHOUT displaying the path as well. This makes */ /* jumping from one file to the next a matter of typing */ /* the first letter(s) of the actual file name, unlike */ /* the original Aurora 'filelist' function where the */ /* path name prevents you from doing that. */ /* */ /* Version: 1.0 -- 8/97 */ /* ----------- */ /* Initial version. */ /* */ /* ------------------------------------------------------------------ */ include bootpath "define.aml" BufferName = "LstFile1" // set buffer name CurrentFile = getcurrbuf // used to display files while CurrentFile do FileName = upcase (getname (getbufname CurrentFile)) // grab just file name if FileName then databuf BufferName (' ' + FileName) end // save name to a buffer end CurrentFile = getprevbuf CurrentFile // get next file name endwhile Selected = popup BufferName 'Loaded Files' 15 // popup the info destroybuf BufferName if Selected then // TRUE if a file was chosen CurrentFile = getcurrbuf // grab current file again while CurrentFile do FileName = upcase (getname (getbufname CurrentFile)) // get file name again if FileName == Selected then // if it matches selected file.. open (getbufname CurrentFile) // ..jump to it end CurrentFile = getprevbuf CurrentFile // ..else get next file name endwhile end /* ------------------------------------------------------------------ */ /* Macro: LSTFILE2.AML */ /* Written by: Jim Wilson */ /* */ /* Description: Macro used to display a list of files being edited */ /* WITHOUT displaying the path as well. This makes */ /* jumping from one file to the next a matter of typing */ /* the first letter(s) of the actual file name, unlike */ /* the original Aurora 'filelist' function where the */ /* path name prevents you from doing that. */ /* */ /* Version: 1.0 -- 8/97 */ /* ----------- */ /* Initial version. */ /* */ /* ------------------------------------------------------------------ */ include bootpath "define.aml" Spaces = " " // used to pad output PadWidth = 15 // space for file name BufferName = "LstFile2" // buffer name CurrentFile = getcurrbuf // save current file number while CurrentFile do FileName = upcase (getname (getbufname CurrentFile)) // grab file name PathName = upcase (getpath (getbufname CurrentFile)) // grab path name NumSpaces = PadWidth - length (FileName) // calculate number of spaces to pad if FileName then databuf BufferName (' ' + FileName + Spaces[1..NumSpaces] + PathName) end // save name to a buffer end CurrentFile = getprevbuf CurrentFile // get next file name endwhile Selected = popup BufferName 'File ÄÄÄÄÄÄÄÄÄ Directory' 60 // popup the info destroybuf BufferName if Selected then // TRUE if a file was chosen CurrentFile = getcurrbuf // grab current file again Selected = Selected[1..((pos ' ' Selected) - 1)] // grab just file name while CurrentFile do FileName = upcase (getname (getbufname CurrentFile)) // get a file name if FileName == Selected then // if it matches selected file.. open (getbufname CurrentFile) // ..jump to it end CurrentFile = getprevbuf CurrentFile // ..else get next file name endwhile end Regards, Jim Wilson (jawilson@ix.netcom.com)