* * * This macro will open a file .directory and list in it all * files that are currently loaded into the editor * * The format for the appended lines is as follows * * ----- blank line ----- * Directory "" Listing of internal files. * .directory Internal * internal file 1 Internal * internal file 2 Internal * . . . * internal file n Internal * ----- blank line ----- * * Note that the definition of s-f4 key (key which loads in the file * that is listed in the .directory file.) should be changed to work * properly with null directory names ("") as shown above. * * def a-enter = [if] [execute] 'edit .directory nomods' [end if] def a-enter + [data cursor] [bottom] [insert line] [insert line] def a-enter + [down 2] [begin line] 'Directory "" Listing of internal files.' def a-enter + [store cursor] def a-enter + [store mark] def a-enter + [clear all flags 100] [set flag 100] * so we know when all files have been scanned def a-enter + [do] def a-enter + [store cursor] def a-enter + [execute] 'edit .directory' def a-enter + [data cursor] [bottom] [insert line] [down] [begin line] def a-enter + [store cursor] * remember position in .directory file def a-enter + [recall cursor 2] * go to the original file def a-enter + [execute] '? name' def a-enter + [command cursor] [mark char] * mark the file name def a-enter + [end line] [backtab word] [left 2] [mark char] def a-enter + [data cursor] def a-enter + [recall cursor] [forget cursor] * go to the .directory file def a-enter + [import mark] * copy the file name def a-enter + [begin line] [right 48] 'Internal' def a-enter + [recall cursor] [forget cursor] * go back to original file def a-enter + [clear command] * clear the command line def a-enter + [next file] * advance to next file def a-enter + [if flag 100] * done with all files def a-enter + [exit loop] def a-enter + [end if] def a-enter + [loop] def a-enter + [command cursor][delete line] def a-enter + [data cursor] [bottom] [insert line] def a-enter + [recall mark] [forget mark] def a-enter + [recall cursor] [forget cursor] def a-enter + [center line 1] def a-enter + [scroll up] [up] [begin line] * this is a necessary * work-around for the bug in [center line #] which scrolls the cursor line * until it's in position #+1 not # as stated in the manual.