Emacs: python-shell doesn't respond to RET
When I start python-shell (or even just start python from M-x shell), Emacs gives the expected prompt:
bash-3.2$ python
Python 2.7.1 (r271:86832, Jun 16 201开发者_如何学编程1, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
But when I type something at the prompt and press RET, the cursor moves down a line but the command is not executed. The only commands I can get the subprocess to respond to are interrupts like C-C C-c. After an interrupt, another prompt (>>>) appears and I can use M-n and M-p to navigate the lines I "entered" earlier.
>>> test
hmmm, definitely pressed enter there
C-c C-c
KeyboardInterrupt
>>>
Curiously, this occurs both in Aquaemacs and in emacs -nw. I've tried moving my .emacs and .emacs.d files and the behavior is the same. Any ideas on what might be causing this?
After you do "M-x shell" and then "python RET", do "C-h k RET" and then what is displayed? the Help buffer should say that "comint-send-input" is the command that is executed for RET. If it isn't showing "comint-send-input" as the command executed by "RET" then there is probably something in one of your init files (the .emacs file isn't the only init file) that is overriding this binding. So, then try running emacs with "emacs -nw -q -no-site-file" and repeat the above. If it wasn't displaying "comint-send-input" previously and is displaying "comint-send-input" now, then it's definitely something in one of your init files. Look at both your local (http://www.gnu.org/software/emacs/emacs-lisp-intro/elisp/Init-File.html#Init-File) and site-wide (http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/Site_002dwide-Init.html#Site_002dwide-Init) init files to try to find the culprit. If it's not obvious after examining the files, your best bet is to rename any init files you find and gradually re-introduce the code until you find what is causing the "breakage".
精彩评论