> All existing commands put a file reference somewhere. I did a test where I did File->New, imported flat.txt, then saved the result as a .leo file. If I open the file in notepad, there's no place I can find that references the original imported file. So at least with File->Import->Import Flattened Outline, it doesn't seem to put a file reference anywhere.
> However, it would be easy enough to remove the file reference from > the tree produced by @auto. I'm not sure how to do this. Here's what I read in Chapter 4: >When reading @auto nodes, Leo creates the @auto tree using >**importers**, parsers that create an outline with nodes for each >class, method and function in the external file. Some importers create >other kinds of nodes as well. > >Importers presently exist for C, elisp, HTML, Java, Javascript, Pascal, >PHP, Python and xml. Leo determines the language using the file's >extension. If no parser exists for a language, Leo copies the entire >body of the external file into the @auto node. I know that there's an importer for .ini as well, here's what I tried in order to "convert" the .ini to a true .leo file (just for testing @auto functionality): File->New Change NewHeadline to @auto t:\x.ini File x.ini is 248K in size. Nothing happened when I did this, so I next did a File->Save As and created t:\x-test.leo. I got a message that x.ini already existed and I said NO to overwrite. The log tab shows: not written: t:\x.ini saved: x-test.leo OK so far, I think. I closed x-test.leo. Trying next to follow this instruction: > However, it would be easy enough to remove the file reference from > the tree produced by @auto. I open x-test.leo in notepad, find the @auto node and remove just the "@auto " from it so that it looks like this: ...<vh>t:\x.ini</vh></v> I save this change and attempt to re-open x-test.leo. One node exists with the headline t:\x.ini and that's it. leoImport.py does not seem to have run. I open x-test.leo in notepad again, put back the "@auto ", save it and open it in Leo again. This time leoImport.py did run and I see lots of nodes. I do File->Save. I open x-test.leo in Notepad again to remove "@auto " (again, I'm trying to follow the instruction, "remove the file reference from the tree produced by @auto"). Very little in the .leo file has changed -- I don't see any of the ini nodes yet -- and I doubt removing the @auto will change anything by I try anyway and on re-opening in Leo it shows the single node containing t:\x.ini as above. 1. Could you provide the specific steps to "remove the file reference from the tree produced by @auto"? 2. Is there a way to have a File->Import... function open a file based on its extension and automatically create an @auto node? There doesn't seem to be an import-at-auto command I can tie to an @menu node, like the import-at-file command. -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
