I want to start a python-shell M-x python-shell
. If I'm not happy with the syntax highlighting, is it possible to improve it (put more colors in the buffer) without changing major mode? In vim this would be simple with set filetype=python
.
The python syntax itself is not highlighted in python-shell mode, I want it to be highlighted.
A simple solution will be favored because I'm just learning about emacs.
font-lock-keywords
for a given mode, then yes. But depending on how the mode function is defined, re-entering the mode might re-highlight using the mode-definedfont-lock-keywords
and not what you have redefined. To be safer in that (but with no guarantee), you would need to redefinefont-lock-keywords
on the mode hook, so that it takes effect each time the mode is turned on, and after the mode code does its thing.font-lock-keywords
in some way, depending on what you want to do.python.el
? IIRC, the one shipped since emacs 24.2 had font lock for the shell as well.