Syntax Highlighting

8 views
Skip to first unread message

Michaelangelo

unread,
Sep 16, 2009, 11:30:42 PM9/16/09
to peppy-dev
Hi, how to change syntax highlighting if I want extension .pt as html
mode?

Adding ~/.peppy/synmap doesn't help.

Thanks.

Michael

Rob McMullen

unread,
Sep 17, 2009, 10:31:48 AM9/17/09
to pepp...@googlegroups.com
On Wed, Sep 16, 2009 at 8:30 PM, Michaelangelo <angfa...@gmail.com> wrote:
> Hi, how to change syntax highlighting if I want extension .pt as html
> mode?

That's actually a really good question. I hadn't thought about that
before, but that's obviously an important thing to have as a
user-settable preference.

> Adding ~/.peppy/synmap doesn't help.

No, that's not something that peppy looks at. In the short term until
I figure out how to make that a preference, you can edit the file
peppy/editra/syntax/synextreg.py and add the ".pt" extension to line
#337, i.e.

'htm html shtm shtml xhtml pt' : LANG_HTML,

but there definitely needs to be a better way to do this. I'll have
to think about it.

Rob

Rob McMullen

unread,
Sep 22, 2009, 12:49:58 AM9/22/09
to pepp...@googlegroups.com
On Wed, Sep 16, 2009 at 8:30 PM, Michaelangelo <angfa...@gmail.com> wrote:
> Hi, how to change syntax highlighting if I want extension .pt as html
> mode?

I'm working on this now. My intention is to add a preference that
will contain extensions for each major mode. You can then modify the
extension list using the preferences dialog.

Rob

Rob McMullen

unread,
Oct 1, 2009, 10:10:37 AM10/1/09
to pepp...@googlegroups.com
On Wed, Sep 16, 2009 at 8:30 PM, Michaelangelo <angfa...@gmail.com> wrote:
> Hi, how to change syntax highlighting if I want extension .pt as html
> mode?

Try the latest 0.12 release. You can now edit filename extensions for
each major mode through the preferences.

Rob

Michaelangelo

unread,
Oct 1, 2009, 10:23:07 PM10/1/09
to peppy-dev
Hi Rob,
First I must thanks for your wonderful job, pushing peppy to the
limits.

The problem now I faced is Syntax Highlighting is completely gone, all
text shown as default black.

Below is what I did to troubleshoot.
* remove whole folder ~/.peppy and restart app. still NO go.

* when I run peppy from command line, I got some warning msg
/usr/local/lib/python2.6/dist-packages/peppy/lib/pkg_resources.py:17:
DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet
/usr/local/lib/python2.6/dist-packages/peppy/lib/setuptools_utils.py:
33: UserWarning: Module site was already imported from /usr/lib/
python2.6/site.pyc, but /usr/local/lib/python2.6/dist-packages/
distribute-0.6.3-py2.6.egg is being added to sys.path
import peppy.lib.pkg_resources as pkg_resources

* I use the latest trunk version with wxPython 2.8.10.1 (gtk2-
unicode).

* I am suspecting distribute-0.6.3 might cause the problem. But
Editra seem ok with it.

* Any suggestions that I can dig into the codes?

Thanks,
Michael

<<<<<<<<<<<<<<
On Oct 1, 10:10 pm, Rob McMullen <rob.mcmul...@gmail.com> wrote:

Rob McMullen

unread,
Oct 2, 2009, 1:10:12 AM10/2/09
to pepp...@googlegroups.com
On Thu, Oct 1, 2009 at 7:23 PM, Michaelangelo <angfa...@gmail.com> wrote:
> Rob,
>   First I must thanks for your wonderful job, pushing peppy to the
> limits.

Thanks!

> The problem now I faced is Syntax Highlighting is completely gone, all
> text shown as default black.

Hmmm, I haven't seen that problem yet.

> Below is what I did to troubleshoot.
> * remove whole folder ~/.peppy and restart app. still NO go.

I wonder if it's two conflicting peppy installs? I changed the syntax
highlighting stuff to be able to support the custom filename
extensions, so if there are old files in the dist-packages directory,
it might cause the problem. I'd suggest removing any of the old
peppy/ directories anywhere in your PYTHONPATH and try to reinstall.

> * when I run peppy from command line, I got some warning msg
> /usr/local/lib/python2.6/dist-packages/peppy/lib/pkg_resources.py:17:
> DeprecationWarning: the sets module is deprecated
>  from sets import ImmutableSet
> /usr/local/lib/python2.6/dist-packages/peppy/lib/setuptools_utils.py:
> 33: UserWarning: Module site was already imported from /usr/lib/
> python2.6/site.pyc, but /usr/local/lib/python2.6/dist-packages/
> distribute-0.6.3-py2.6.egg is being added to sys.path
>  import peppy.lib.pkg_resources as pkg_resources

I do see the first warning, but I don't see the second. I didn't
realize that distribute was a fork of setuptools; so I bet you're
right: that's probably causing the second warning. I've only used
setuptools.

I'll have to upgrade the setuptools I provide in the peppy/lib
directory to the latest version and see if that fixes the problem.

Rob

Reply all
Reply to author
Forward
0 new messages