The only "escape" mechanism is that g.angleBrackets(s) will return s
surrounded by '<<' and '>>'.
I assume you mean that Leo's read and write code would provide a way
of saying, "ignore what looks like a section reference in this line
(or piece of code)".
Sorry, but that can never happen. More than 10 years ago now, when I
first discovered noweb and decided to base Leo's LP syntax on noweb, I
made an explicit decision not to support any of noweb's escape
conventions. This was based on my experience of trying to support
escape conventions in @root trees. It's a nightmare. I have never
once regretted this decision.
Edward
So if I want to @shadow a file that has lines like:
cat << EOF >> cdebootstrap/suites
I'm just screwed? This is a pretty common idiom in shell scripts, and
would pretty much stop me from using Leo as my main editor, as I've been
intending on doing (or more likely cause me to do some awful
site-specific hack).
IMHO a better way of dealing with this would be to allow the user to
control the redefinition of "special" noweb characters, either
per-document, per-node, and/or in myLeoSettings.leo - e.g. I would think
pretty much zero languages that would be upset by '<<<' and '>>>' or
something like that (sort of similar to how python's """ operator is
usually pretty safe).
This is how a lot of template languages, that often have similar issues
with clashing with the syntax of the documents they are being used to
template, work - e.g.
http://www.cheetahtemplate.org/docs/users_guide_html_multipage/parserInstructions.compiler-settings.html
Cheers,
--
Daniel JB Clark | Sys Admin, Free Software Foundation
pobox.com/~dclark | http://www.fsf.org/about/staff#danny
> So if I want to @shadow a file that has lines like:
>
> cat << EOF >> cdebootstrap/suites
>
> I'm just screwed?
You have several options, including:
1. Use @shadow and revise code to avoid << and >> on the same line.
2. Use @noref for "problematic" files.
3. Use one of several Leo plugins to manage script files. Consider
the read_only_nodes or at_folder plugins:
http://webpages.charter.net/edreamleo/plugins.html#nodes
Note: using some kind of escape mechanism for << and >> implies having
the ability to change (if only slightly) the contents of the file. If
you can do that, option 1 applies. If not, options 2 and 3 apply.
Edward
P.S. Longer term, some extensions to Leo could be considered.
A. Stephen suggests extending the role of the @verbatim *sentinel*.
An @verbatim *directive* would, unless I am mistaken, create an
@@verbatim sentinel. This could probably be made to work cleanly,
though it would imply significant changes to Leo's fundamental
read/write code.
But in your use case, it's not clear to me that adding @verbatim
directives would be preferable to putting << and >> on separate
lines...
B. Something like @shadow-noref, could have exactly the same read
logic as @shadow, and the same write logic as @noref. This would give
you an "escape" that applies to an entire file.
The @shadow algorithm will work with regardless of the meaning of '<<'
and '>>'. In fact, the fundamental @shadow algorithm knows nothing
about Leo section references or markup. It does know about sentinels,
but in a minimalist way. In fact this "lack of knowledge" is what
makes @shadow work so well. Bernhard Mulder's algorithm is pure
genius.
I am not eager to do either A or B, but I am not ruling them out completely.
EKR