Return-Path: owner-aurora-editor@sfu.ca Return-Path: Received: from rm-rstar.sfu.ca by icpsr.umich.edu (8.8.7/2.2) with ESMTP id XAA15899; Sun, 2 Nov 1997 23:01:33 -0500 (EST) Message-Id: <3.0.1.16.19971102220251.339758ae@popd.ix.netcom.com> X-Sender: jawilson@popd.ix.netcom.com (Unverified) X-Mailer: Windows Eudora Light Version 3.0.1 (16) Date: Sun, 02 Nov 1997 22:02:51 To: aurora-editor@sfu.ca From: Jim Wilson Subject: LSTFILES macro Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Okay, so I was wrong -- it's not the last time your going to hear about this macro... I've updated the LSTFILES macro to include something that I realized was a glaring omission; an indication of what file(s) have been modified. Auroras 'filelist' function places an asterick next to the name of any file that has been modificed but not saved -- LSTFILES did not, but now it does. Whenever you see an asterick at the end of a file name it means the same thing that it does for Auroras 'filelist' function; e.g. the file has been modified. The reason the asterick is not before the file name(s) -- the method I would have prefered -- is because it screwed up the auto-advance feature. You can go ahead and modify that aspect of it if you'd like (just look for the lines that start with "(databuf (BufferName" and then locate the part where it says "if? (bufchanged CurrentFile"). Let me know if you have any problems with it. Jim /* ------------------------------------------------------------------ */ /* Macro: LSTFILES.AML */ /* Written by: Jim Wilson */ /* */ /* Description: Macro used to display a list of files being edited */ /* WITHOUT displaying the path before the file name. */ /* 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. */ /* */ /* */ /* 2.0 -- 10/97 */ /* ------------ */ /* Combined the original LSTFILE1 and LSTFILE2 into a */ /* a single program called LSTFILES. */ /* */ /* Modified the window title to show the total number */ /* of files being edited. */ /* */ /* Added a function that adjusts the window size if a */ /* lot of files are to be displayed in the popup. */ /* */ /* Added the 'f' argument (full) to display the path */ /* as well as the file name. */ /* */ /* Added the 'n' argument (numbers) to display a number */ /* before each file so you can use that to jump from */ /* one file to the next. */ /* */ /* */ /* 2.0a -- 10/97 */ /* ------------- */ /* Displays an asterick at the end of any file name */ /* that has been modified. */ /* */ /* ------------------------------------------------------------------ */ include bootpath "define.aml" Spaces = " " // used to pad output Options = arg 2 // grab any args passed PadWidth = 14 // space for file name BufferName = "LstFiles" // buffer name TotalFiles = 0 // total files being edited CurrentFile = getcurrbuf // save current file number if? (pos 'f' Options 'i') (FullDisplay = TRUE) (FullDisplay = FALSE) // setup for display window type if? (pos 'n' Options 'i') (ShowNumbers = TRUE) (ShowNumbers = FALSE) // setup for display of numbers while CurrentFile do FileName = upcase (getname (getbufname CurrentFile)) // grab just the file name PathName = upcase (getpath (getbufname CurrentFile)) // grab just the path name NumSpaces = PadWidth - length (FileName) // calculate number of spaces to pad display if FileName then TotalFiles = TotalFiles + 1 // add one to counter for # of files if? FullDisplay // setup filename for displaying (databuf BufferName ((if? ShowNumbers TotalFiles:2 '') + ' ' + FileName + Spaces[1..NumSpaces] + (if? (bufchanged? CurrentFile) '* ' ' ') + PathName) end) (databuf BufferName ((if? ShowNumbers TotalFiles:2 '') + ' ' + FileName + (if? (bufchanged? CurrentFile) ' *' ' ')) end) endif CurrentFile = getprevbuf CurrentFile // get next file name endwhile Selected = popup BufferName // setup title and window size (if? FullDisplay ('File Name ÄÄÄÄ Directory NameÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Files: ') ('Files: ')) + TotalFiles (if? FullDisplay (60) (15)) // popup window width (if? TotalFiles > (getvidrows)-8 (getvidrows)-8) // popup window height destroybuf BufferName // remove temp buffer if Selected then // TRUE if a file was chosen CurrentFile = getcurrbuf // grab current file again case ShowNumbers // find 1st char in file name when TRUE FirstChar = (pos '[0-9] ' Selected 'x') + 2 when FALSE FirstChar = (pos '^ .' Selected 'ix') + 1 endcase case FullDisplay // find last char in file name when TRUE LastChar = (pos ' ' Selected) - 1 when FALSE LastChar = (length Selected) - 2 endcase while CurrentFile do FileName = upcase (getname (getbufname CurrentFile)) // get a file name if FileName == Selected [FirstChar..LastChar] then // if it matches selected file.. open (getbufname CurrentFile) // ..jump to it endif CurrentFile = getprevbuf CurrentFile // ..else get next file name endwhile endif Regards, Jim Wilson jawilson@ix.netcom.com)