0

I am finally getting close to a nice emacs environment, based off of this baseline. However, many of the python-emacs tutorials mention things like "C-c C-c to run this in a python shell", or "C-c !" to launch a python shell". For some reason I am not getting this functionality. I am getting C-c C-c is undefined. What does work is M-x run-python.

Why am I not getting the standard behavior? I am running emacs through cygwin, which has both python and ipython installed.

1 Answer 1

1

Your sample init.el uses a different python mode than the tutorials you read.

python-mode.el (line 3147/3152) defines:

(define-key map [(control c)(control c)] 'py-execute-buffer) (define-key map [(control c)(!)] 'py-shell) 

but does not define run-python, which is instead defined in python.el, which is distributed with emacs since version 24.3. and is set as the default python mode in your referenced init.el.

See EmacsWiki: Programming With Python Mode Dot El for setup instructions for python-mode.el.

Sign up to request clarification or add additional context in comments.

9 Comments

Can you explain the difference between python.el and python-mode.el? Should I use them both or only one?
You you use only one major mode per buffer, for differences see: stackoverflow.com/questions/15670505/…
I'm still a bit confused. The init.el file I linked to references python-mode, and I have a python-mode folder (~/.emacs.d/elpa/python-mode-20150909.2301). Why is emacs using python.el? I'm trying to change my init.el file, but this is throwing me off.
C-c C-c should work. What is the contents of buffer when called? What says C-h v major-mode?
C-c C-c is undefined. And C-h v major-mode says Its value is python-mode when a .py file is in the buffer.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.