This was not a design error, it was an understandable misunderstanding
of what the function marker_from_extension was expecting. Here's a
patch:
[EMAIL PROTECTED] thyrsus1]$ bzr diff
=== modified file 'leo/core/leoAtFile.py'
--- leo/core/leoAtFile.py 2008-10-03 21:02:41 +0000
+++ leo/core/leoAtFile.py 2008-10-24 20:22:20 +0000
@@ -2571,8 +2571,9 @@
# Bug fix: Leo 4.5.1: use x.markerFromExtension to force the
delim to match
# what is used in x.propegate changes.
- junk,ext = g.os_path_splitext(fn)
- marker = x.marker_from_extension(ext,addAtSign=False)
+ # Note: marker_from_extension takes the file name as the
argument, not the
+ # extension itself.
+ marker = x.marker_from_extension(fn,addAtSign=False)
# g.trace('write marker',marker)
at.startSentinelComment = marker
at.endSentinelComment = None
On Oct 23, 6:42 pm, thyrsus <[EMAIL PROTECTED]> wrote:
> Would it be acceptable to default to "@language plain" instead of
> "@language unknown_language", which (without looking at the code) I'm
> going to guess would set self.startSentinelComment to "#" instead of
> undefined? And then we could override that with the closest ancestor
> "@language" or "@delims" statement?
>
> Another question: how do/should we handle Leo guessing the language
> wrong? E.g., ".pl" is the suffix for both perl and prolog; Unix
> actually doesn't care - there's either the magic bytes of a binary
> executable at the beginning (in which case the convention is not to
> have a suffix), or "#! /path/to/interpreter" if the file is
> interpretable by a scripting language. Any other interpretation is
> the application's responsibility, so we get to invent the rules
> ourselves.
>
> - Stephen
>
> On Oct 23, 7:07 am, "Edward K. Ream" <[EMAIL PROTECTED]> wrote:
>
> > On Thu, Oct 23, 2008 at 2:21 AM, thyrsus <[EMAIL PROTECTED]> wrote:
>
> > Thanks for this report.
>
> > > with the headline "@shadow CHANGELOG"
>
> > [snip]
>
> > > File "/usr/local/lib/leo/core/leoAtFile.py", line 3136, in
> > > putCodeLine
> > > if g.match(s,k,self.startSentinelComment + '@'):
> > > TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
>
> > The last line of a traceback is telling us that
> > self.startSentinelComment is None, presumably because the file has no
> > extension. I'll fix this bug soon.
>
> > Edward
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---