Re:Python Mode in Emacs
by cgrubb on Wednesday December 01, 2010 @11:32PM
(#1961017)
If you highlight the following code with python.el:
a and b will be highlighted in orange. However, in this code they will not:
I tried to modify python.el so that variables defined by parallel assignment would get highlighted.
I made the following imperfect change to python.el:
The change is imperfect because it only highlights up to 4 variables created by parallel assignment. It does not work for this code:
If anybody is good enough with Emacs Lisp to handle the general case I would be interested to see it.
[ Parent
| on HN ]
It's not just parallel assignment, it's destructuring assignment:
>>> a, (b, (c, d), e) = 1, (2, [3, 4], 5)
>>> a
1
>>> b
2
>>> c
3
>>> d
4
>>> e
5
The question is how far you go with the highlighting.