all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: How prevent Emacs from sending ^M to *Python*? [SUCCESS STORY]
Date: Thu, 22 Sep 2011 01:39:14 +0300	[thread overview]
Message-ID: <j5dp2m$uuu$1@dough.gmane.org> (raw)

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.




                 reply	other threads:[~2011-09-21 22:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='j5dp2m$uuu$1@dough.gmane.org' \
    --to=gavenkoa@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.