From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: How prevent Emacs from sending ^M to *Python*? [SUCCESS STORY] Date: Thu, 22 Sep 2011 01:39:14 +0300 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1316644786 31896 80.91.229.12 (21 Sep 2011 22:39:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Sep 2011 22:39:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 22 00:39:42 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R6VSA-0001zX-Fl for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Sep 2011 00:39:42 +0200 Original-Received: from localhost ([::1]:43048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6VS6-0006zt-MX for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Sep 2011 18:39:38 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6VS2-0006zk-GP for help-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:39:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6VS1-0003rk-Ii for help-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:39:34 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:55152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6VS1-0003rV-9a for help-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:39:33 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R6VRz-0001uR-K0 for help-gnu-emacs@gnu.org; Thu, 22 Sep 2011 00:39:31 +0200 Original-Received: from 160-37-202-46.pool.ukrtel.net ([46.202.37.160]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Sep 2011 00:39:31 +0200 Original-Received: from gavenkoa by 160-37-202-46.pool.ukrtel.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Sep 2011 00:39:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 38 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 160-37-202-46.pool.ukrtel.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82277 Archived-At: 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 "", 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.