Re: best way to deal with unknow extension in shadow?

2008-08-20 Thread vitalije
Warning: changing the @language directive in an @shadow node can cause quite a mess if you don't change the file's extension to match the new language. Leo's @shadow code can get totally confused. I'm not sure there is a solution that doesn't cause more complications. Why Leo don't use

Re: best way to deal with unknow extension in shadow?

2008-08-20 Thread Edward K. Ream
On Wed, Aug 20, 2008 at 6:48 AM, vitalije [EMAIL PROTECTED] wrote: Why Leo don't use for all kinds of files same sentinels in private files ? Possible, I suppose, but I don't want to destroy the validity of private files absent an overwhelmingly good reason. Private files ought to be valid

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread TL
I don't know why @shadow needs to have a known file type but they are easy to add. Here are the very simple additions that need to be made to the leoApp.py file to add a new extension. Given an extension of .abc used by the Acme Binary Compiler that supports comments in the form of ';' for

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Edward K. Ream
On Aug 19, 7:35 am, TL [EMAIL PROTECTED] wrote: I don't know why @shadow needs to have a known file type Private files store outline structure in sentinels. Sentinels are comment lines so Leo needs to know the comment delims. Fake delims will *not* do: they could clash with valid

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Terry Brown
On Tue, 19 Aug 2008 06:10:11 -0700 (PDT) Edward K. Ream [EMAIL PROTECTED] wrote: Private files store outline structure in sentinels. Sentinels are comment lines so Leo needs to know the comment delims. Fake delims will *not* do: they could clash with valid characters. Ah, I didn't think of

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Kent Tenney
On Tue, Aug 19, 2008 at 8:10 AM, Edward K. Ream [EMAIL PROTECTED] wrote: On Aug 19, 7:35 am, TL [EMAIL PROTECTED] wrote: I don't know why @shadow needs to have a known file type Private files store outline structure in sentinels. Why not default to verbatim file representation if Leo

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Edward K. Ream
On Tue, Aug 19, 2008 at 8:51 AM, Kent Tenney [EMAIL PROTECTED] wrote: Why not default to verbatim file representation if Leo doesn't have sufficient information about this file extension? I think this would be quite confusing. You get the file, and add nodes, like you might with any other

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Peter Bienstman
Edward K. Ream wrote: Private files store outline structure in sentinels. Sentinels are comment lines so Leo needs to know the comment delims. Fake delims will *not* do: they could clash with valid characters. I'm not sure I understand completely. The shadow files are only for Leo's

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Kent Tenney
On Tue, Aug 19, 2008 at 9:13 AM, Edward K. Ream [EMAIL PROTECTED] wrote: On Tue, Aug 19, 2008 at 8:51 AM, Kent Tenney [EMAIL PROTECTED] wrote: Why not default to verbatim file representation if Leo doesn't have sufficient information about this file extension? I think this would be quite

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Terry Brown
On Tue, 19 Aug 2008 07:33:44 -0700 (PDT) Peter Bienstman [EMAIL PROTECTED] wrote: especially if they start and end with a sequence which has vanishingly small probability of occurring in the original file (e.g. [EMAIL PROTECTED] sentinel [EMAIL PROTECTED]). That seems reasonable? Cheers

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Edward K. Ream
On Tue, Aug 19, 2008 at 9:37 AM, Kent Tenney [EMAIL PROTECTED] wrote: Can you provide an example? Is it a matter of a @setting? Yes. Here is the body text of leoSettings.leo, the node @settings--File options--Shadow files--@data shadow_delims:: # Comment lines starting with '#' (like this

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Terry Brown
On Tue, 19 Aug 2008 12:40:41 -0500 Edward K. Ream [EMAIL PROTECTED] wrote: Ah. I remember now why no made-up delim can work: sometime later a language may become known. In that case, we will have to throw away all private files. Or look for two possible delims, the newly known one, and the

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Edward K. Ream
On Tue, Aug 19, 2008 at 12:53 PM, Terry Brown [EMAIL PROTECTED] wrote: Or look for two possible delims, the newly known one, and the generic omni-delim. I understand why this might seem plausible, but what you probably don't realize is that the code is facing a combinatorial explosion of

Re: best way to deal with unknow extension in shadow?

2008-08-19 Thread Edward K. Ream
On Aug 19, 1:03 pm, Edward K. Ream [EMAIL PROTECTED] wrote: The importer now knows to insert '@language huh_language', and the file write code has several major hacks to get the proper comment delimiter for sentinels ('##@') On second (or third) thought, Leo can indeed use a single unknown