From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Evgeniy Sharapov Newsgroups: gmane.emacs.bugs Subject: bug#28051: 25.2; Multiline Statement Indentation Error in Inferior Python Mode Date: Thu, 24 Aug 2017 22:50:28 -0400 Message-ID: References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> <87o9rby5ty.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114e521e2dd9d805578b0356" X-Trace: blaine.gmane.org 1503629477 6505 195.159.176.226 (25 Aug 2017 02:51:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Aug 2017 02:51:17 +0000 (UTC) Cc: 28051@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 25 04:51:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl4iA-00018X-25 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Aug 2017 04:51:06 +0200 Original-Received: from localhost ([::1]:51266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dl4iG-0005us-QU for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Aug 2017 22:51:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dl4iA-0005ul-Lb for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 22:51:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dl4i6-0004cD-L5 for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 22:51:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44729) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dl4i6-0004c3-H5 for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 22:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dl4i6-0001G4-4d for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 22:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Evgeniy Sharapov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2017 02:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28051 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch confirmed Original-Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.15036294564825 (code B ref 28051); Fri, 25 Aug 2017 02:51:02 +0000 Original-Received: (at 28051) by debbugs.gnu.org; 25 Aug 2017 02:50:56 +0000 Original-Received: from localhost ([127.0.0.1]:53410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl4hz-0001Fl-Qa for submit@debbugs.gnu.org; Thu, 24 Aug 2017 22:50:56 -0400 Original-Received: from mail-vk0-f48.google.com ([209.85.213.48]:32781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dl4hy-0001FY-Hn for 28051@debbugs.gnu.org; Thu, 24 Aug 2017 22:50:54 -0400 Original-Received: by mail-vk0-f48.google.com with SMTP id j189so3995861vka.0 for <28051@debbugs.gnu.org>; Thu, 24 Aug 2017 19:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9CQOikM2jmj5vmjHhXRk4McvbApJcVQCi+SvVYJy6qk=; b=kFE2AD55FiOK9CcckgkWedeAoMGim8SiLsVC/rnFu6SGBkp5z0k6htlZwNkeSXEdl0 HuSIrSQqL2nfhYYW75lzmRralZn6/5+fReGUwwVCrQ7XBU80TLMDe18lAFbVYL8JQYSq +znxh/6CcYwAKKTEpycTZmxBeTptTXtdTSFNROCmn9x4KXyQDNezHN8WRv+aC5Fmm3AL PSxNX89caF8BxdDBjW6qqR/D4RNL1czkEe94W2IuhEsCdx5C7Rxp8QYaZnofRWdJaX4q XsWy4FlhBv68lceU4UFTxM73UDb4FcMN7nq/cxDiAWi1cBvjhFCuai9NUhE2rcfUxe8c Rbwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9CQOikM2jmj5vmjHhXRk4McvbApJcVQCi+SvVYJy6qk=; b=LR1eGw5RSdvtiV/qZwYpkbqZphsMvuryF9Jd6gJQiSvEIC8b62cTiReEbMvL6RVbbO pA08QjRTedpaUx5UhrHiKWhuJNiEAImWAVREUdAcIYVQsaOGnkBvg1wLCiBxEDzd9w8E fx0yARK/g12yisgrNw+/lklW+sVRSij4/oXkrGKsqdew1Efrbh+dQvxqyhdowFstbsMI m60W4BSmnDvEQKMDd5ByETnLWTEgvDRY4SWmgOXOHyE2D3pMWuZUUSxCZcfv205L31Jm bBnM6nste26xs6n9iplUa1cJ7MivotLsDse1PJdvU9De292+6DWQPp3rHNNfIndWDFAn 0FCQ== X-Gm-Message-State: AHYfb5gtjTH4Q39gNwEmR7uGR37YVKrYCYVCixwfKI2C81SZ4X7jpm3/ 4cAxyGhHB7GmD9pF0v2yNau93GzDXA== X-Received: by 10.31.84.7 with SMTP id i7mr4798378vkb.34.1503629448958; Thu, 24 Aug 2017 19:50:48 -0700 (PDT) Original-Received: by 10.31.141.86 with HTTP; Thu, 24 Aug 2017 19:50:28 -0700 (PDT) In-Reply-To: <87o9rby5ty.fsf@users.sourceforge.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:136178 Archived-At: --001a114e521e2dd9d805578b0356 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I have pyreadline installed. It does help in a sense that completion works then in the inferior python mode, although I get following *Warning* buffer Warning (python): Python shell prompts cannot be detected. If your emacs session hangs when starting python shells recover with =E2=80=98keyboard-quit=E2=80=99 and then try fixing the interactive flag for your interpreter by adjusting the =E2=80=98python-shell-interpreter-interactive-arg=E2=80=99 or add regexps matching shell prompts in the directory-local friendly vars: + =E2=80=98python-shell-prompt-regexp=E2=80=99 + =E2=80=98python-shell-prompt-block-regexp=E2=80=99 + =E2=80=98python-shell-prompt-output-regexp=E2=80=99 Or alternatively in: + =E2=80=98python-shell-prompt-input-regexps=E2=80=99 + =E2=80=98python-shell-prompt-output-regexps=E2=80=99 Warning (python): Your =E2=80=98python-shell-interpreter=E2=80=99 doesn=E2= =80=99t seem to support readline, yet =E2=80=98python-shell-completion-native-enable=E2=80=99 was t= and "python" is not part of the =E2=80=98python-shell-completion-native-disabled-interprete= rs=E2=80=99 list. Native completions have been disabled locally. But the *Python* buffer says everythng has been loaded ok Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> python.el: native completion setup loaded >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Evgeniy N. Sharapov Phone: (630) - 779 - 3208 On Sat, Aug 19, 2017 at 10:45 AM, wrote: > evgeniy.sharapov@gmail.com writes: > > > leads to IndentationError once I try to enter multi-line statements in > > the Inferior python mode. > > > > Steps: > > > > 1. Start Emacs > > 2. M-x run-python > > 3. try to enter something simple like > > > > for x in range(10): > > print x > > > > 4. The following error occurs: > > > > File "", line 1 > > print x > > ^ > > IndentationError: unexpected indent > > Does it help if you install pyreadline? From comments in python.el: > > ;; If your > ;; Python installation lacks readline (like CPython for Windows), > ;; installing pyreadline (URL `http://ipython.org/pyreadline.html') > ;; should suffice. To troubleshoot why you are not getting any > ;; completions, you can try the following in your Python shell: > > ;; >>> import readline, rlcompleter > > ;; If you see an error, then you need to either install pyreadline or > ;; setup custom code that avoids that dependency. > --001a114e521e2dd9d805578b0356 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have pyreadline installed. It does help in a sense that = completion works then in the inferior python mode, although I get following= *Warning* buffer

Warning (python): Python shell pr= ompts cannot be detected.
If your emacs session hangs when starti= ng python shells
recover with =E2=80=98keyboard-quit=E2=80=99 and= then try fixing the
interactive flag for your interpreter by adj= usting the
=E2=80=98python-shell-interpreter-interactive-arg=E2= =80=99 or add regexps
matching shell prompts in the directory-loc= al friendly vars:
=C2=A0 + =E2=80=98python-shell-prompt-regexp=E2= =80=99
=C2=A0 + =E2=80=98python-shell-prompt-block-regexp=E2=80= =99
=C2=A0 + =E2=80=98python-shell-prompt-output-regexp=E2=80=99<= /div>
Or alternatively in:
=C2=A0 + =E2=80=98python-shell-pro= mpt-input-regexps=E2=80=99
=C2=A0 + =E2=80=98python-shell-prompt-= output-regexps=E2=80=99
Warning (python): Your =E2=80=98python-sh= ell-interpreter=E2=80=99 doesn=E2=80=99t seem to support readline, yet =E2= =80=98python-shell-completion-native-enable=E2=80=99 was t and "python= " is not part of the =E2=80=98python-shell-completion-native-disabled-= interpreters=E2=80=99 list.=C2=A0 Native completions have been disabled loc= ally.=C2=A0



But the = *Python* buffer says everythng has been loaded ok


Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016,= 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help&q= uot;, "copyright", "credits" or "license" for= more information.
>>> python.el: native completion setu= p loaded
>>>




=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=C2=A0 Evgeniy N. Sharapov
=C2= =A0 Phone: (630) - 779 - 3208
=C2=A0

On Sat, Aug 19, 2017 at 10:45 AM, <npostavs@users.sourceforge.net> wrote:
evgeniy.sha= rapov@gmail.com writes:

> leads to IndentationError once I try to enter multi-line statements in=
> the Inferior python mode.
>
> Steps:
>
> 1. Start Emacs
> 2. M-x run-python
> 3. try to enter something simple like
>
>=C2=A0 =C2=A0 for x in range(10):<RET>
>=C2=A0 =C2=A0 <TAB>print x<RET>
>
> 4. The following error occurs:
>
> File "<stdin>", line 1
>=C2=A0 =C2=A0 =C2=A0print x
>=C2=A0 =C2=A0 =C2=A0^
> IndentationError: unexpected indent

Does it help if you install pyreadline?=C2=A0 From comments in python.el:
=C2=A0 =C2=A0 ;; If your
=C2=A0 =C2=A0 ;; Python installation lacks readline (like CPython for Windo= ws),
=C2=A0 =C2=A0 ;; installing pyreadline (URL `http://ipython.org/pyreadline.html')
=C2=A0 =C2=A0 ;; should suffice.=C2=A0 To troubleshoot why you are not gett= ing any
=C2=A0 =C2=A0 ;; completions, you can try the following in your Python shel= l:

=C2=A0 =C2=A0 ;; >>> import readline, rlcompleter

=C2=A0 =C2=A0 ;; If you see an error, then you need to either install pyrea= dline or
=C2=A0 =C2=A0 ;; setup custom code that avoids that dependency.

--001a114e521e2dd9d805578b0356--