[Python-mode] [ python-mode-Patches-1194875 ] better (and more) coloring

SourceForge.net noreply at sourceforge.net
Sun Jun 5 00:11:02 CEST 2005


Patches item #1194875, was opened at 2005-05-03 19:44
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581351&aid=1194875&group_id=86916

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jonas Kölker (jonaskoelker)
Assigned to: Nobody/Anonymous (nobody)
Summary: better (and more) coloring

Initial Comment:
this patch fixes some coloring problems. It's made
against 4.70 (I diffed the CVS version against my
debian/sarge python-mode.el: equal)

--- fixed stuff

try:pass colors everything except the :
(same for except and finally)
they still color the colon turquoise if there's at
least one space or newline. If colon-coloring should be
turned off, it's a simple swap-three-lines operation.

it also correctly colors str(id(type(len))); but only
(damn!) because it alternates between typenames and
builtins.

fixes not coloring the last exception in a tuple (and
probably other similar things).

(imo) correctly colors ValueError in
`exceptions.ValueError'.

adds set and frozenset to typenames.

--- tweakable stuff:
selecting alternate face for typenames (int, dict, type)
selecting alternate face for builtins (exceptions, len, id)
(these two defaults to kw-turquoise)

selecting alternate face for numeric literals (but
currently the RE-matching is dodgy)
selecting alternate face for the first variable name in
a for ... in (both expressions and statements) (it
should be extended to more than just the first).
(these two default to a vanilla face, 'py-plain-face)


----------------------------------------------------------------------

>Comment By: Skip Montanaro (montanaro)
Date: 2005-06-04 17:11

Message:
Logged In: YES 
user_id=44345

Thanks...  I applied the patch locally and will play around with it a bit.
Attached is a slightly tweaked diff.  There were a couple rejects because
of other recent changes with the keyword re's.  Can you give it a whirl?
Any chance you can fix the FIXMEs?  I don't see any coloring for
numeric literals.  Should I?  I suspect that will be something a lot of
people won't want, so there should be a way to disable it, and that should
probably be the default.


----------------------------------------------------------------------

Comment By: Jonas Kölker (jonaskoelker)
Date: 2005-05-03 19:46

Message:
Logged In: YES 
user_id=1153395

sorry, I (something)ed up uploading the patch.

Scene 24, take 2.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581351&aid=1194875&group_id=86916


More information about the Python-mode mailing list