I am using emacs 23 -nw and xterm installed on Debian Squeeze. I need highlighting with python but I don’t have it. How can I enable it?
Edit:
Thanks for all answers, the problem is that
- I have googled a lot, really.
- I have the code on a file with extension .py
- The script starts with #!/usr/bin/python, as one of the the answers points I have changed to !#/usr/bin/env python
- I used M-x and tried to find something related to python, well there many options which do not solve my problem.
Sorry my question was not very precise and I even accept -10 but I don’t have highlight which would give me red highlight for lines starting # etc. To be more precise I have a very a dull highlight; lines with # are white, lines between “”” “”” are green, some of the variable names are yellow but don’t know why not all. [import, as, from] are light blue, [open, max, and other function names] are dark blue etc. And besides my 200 lines of code is working.
If you run Emacs from
xtermwithemacs -nw, you’ll have a different color layout than if you run the same color mode in an X window. Differences include big changes in the highlighting of comments, different colors assigned to various keywords and (rarely in my experience, though Python comments seem to fall into this category) failure to highlight some elements.I’m not really sure why this happens, but it doesn’t seem to be a problem on your end since it’s consistent on every machine I’ve worked on. If it really bugs you, and you really, really want to keep running from
xterm, take a look at the color-theme module, it may help.