[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How prevent Emacs from sending ^M to *Python*? [SUCCESS STORY]
From: |
Oleksandr Gavenko |
Subject: |
How prevent Emacs from sending ^M to *Python*? [SUCCESS STORY] |
Date: |
Thu, 22 Sep 2011 01:39:14 +0300 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1 |
I use native GNU Emacs under Windows and Cygwin.
I hear that python-mode provide basic completion
functionality so try to use it.
When I try complete symbol by M-TAB in python-mode
Emacs freeze.
*Python* buffer show:
>>> File "<stdin>", line 1
emacs.complete("os.","import re\nimport os\n")
^
SyntaxError: invalid syntax
After week of Expect studying I get stdin/stdout logger and
I found that Python process itself get such data:
import emacs
emacs.complete("os.","import re\nimport os\n")^M
emacs.complete("os.EX","import re\nimport os\n")^M
so I think that root of evil is ^M issue.
After all I deep into 'python-send-string' function from
'python.el'.
It use 'comint-send-string' which use 'process-send-string',
which was written in C...
I try look for variable that related to 'process-' prefix
and found 'process-coding-system-alist' variable and
after
(add-to-list 'process-coding-system-alist
'("python" cp1251-unix . cp1251-unix))
completion start work! Love you, Emacs.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- How prevent Emacs from sending ^M to *Python*? [SUCCESS STORY],
Oleksandr Gavenko <=