I have been trying to configure Emacs to use the proper Python mode. To this end I have read a few tutorials. Most importantly this one. The tutorial uses the python-mode
package. However, when I install it through the package manager (M-x package-install RET python-mode RET
) I can not use the shortcuts that are available for that package.
I opened up a Python file to test some shortcuts such as C-c |
, which should evaluate the selected expression. However, to my surprise these did not work so I decided to find out other tutorials on the topic. However, in my mode-line I do see Python
, so there is some python-mode
enabled.
On the emacs wiki I found the following snippet to add to my init.el
file:
(autoload 'python-mode "python-mode" "Python Mode." t)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
When I add this the python-mode
actually works and the aforementioned shortcuts work as well.
I do not understand properly what this does more than manually executing M-x python-mode
in a python file buffer.
When I removed every trace of python-mode
in my .emacs folder and opened up a python file I noticed that I still have a python-mode
. So my guess is that there are two python-mode
s?
I think I want the python-mode
from https://launchpad.net/python-mode. It seems that it is present in the package repository, but I am unsure how to remove the other Python mode.
Could somebody elaborate please?