From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: 25.2; Multiline Statement Indentation Error in Inferior Python Mode Resent-From: evgeniy.sharapov@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Aug 2017 17:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28051 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 28051@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.150247407423230 (code B ref -1); Fri, 11 Aug 2017 17:55:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Aug 2017 17:54:34 +0000 Received: from localhost ([127.0.0.1]:55965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgE8n-00062a-HT for submit@debbugs.gnu.org; Fri, 11 Aug 2017 13:54:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgDgG-0005Nd-Dn for submit@debbugs.gnu.org; Fri, 11 Aug 2017 13:25:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgDg9-0002OK-8D for submit@debbugs.gnu.org; Fri, 11 Aug 2017 13:24:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47821) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dgDg9-0002OE-4V for submit@debbugs.gnu.org; Fri, 11 Aug 2017 13:24:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgDg6-0006e2-QW for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2017 13:24:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgDg3-0002L5-HK for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2017 13:24:54 -0400 Received: from mail-qt0-x232.google.com ([2607:f8b0:400d:c0d::232]:32942) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgDg3-0002KX-Bk for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2017 13:24:51 -0400 Received: by mail-qt0-x232.google.com with SMTP id a18so24863163qta.0 for ; Fri, 11 Aug 2017 10:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7lSjTKKF03Xi+TXVrQx3MsD7d3yQQDeclb8VxvFGhQQ=; b=nq8FGhBlQkNk6+eFPi78wIP1/qXyVqgl025vsWxNfcxPkBJsbYkuZuVVwKodmS8dAs rXwEpV0X7vleFReEkLPkScHjHGUlyR5OU6uPKFFKUAQ/jkqxV/+tPRFQivpAUhnaz2yC OfCpeQQ7kuvGzsSQ1vPTEp3S8oG9uIOoFSv7uYKHYcc80MCeFh5POLosP8KBs4vcz9wJ bvIW1NhqFcwQ7rgRjEKjTI7kXOG9SyCdTiJWHQb7Xpg6CJC1f5gpzf0DmODpoE07ZlPw kRzZEo/KpxcgWBj3mj73bLbqdiNKPU/p5Hcy3eST7RE8FGATCHYsBnN1eBHNTzIhgvmJ eaCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7lSjTKKF03Xi+TXVrQx3MsD7d3yQQDeclb8VxvFGhQQ=; b=dLvDmGQOl3MpXfNdC5iTqSU+NcZ62OTGRQXqCWpA8U+r146OA6mGTzIt3RzrDbkmjS BqbiBbiV6YExWkwEs/NRF8vgel4kiIS2bbNeks0YV5a5iealIhADIjXZ1os/6tgh7d7v MzMyCu0TWDLVuQ/I4UNlua1uNEyifomGlYqLswWsi6sMZChu7kKBiyBRNzRBiCO2Ir9h jcPYYEA+LjwlesJkWIP1i4ZyCLR8VjmwttSSZ8sKWhymiP2vIIe7CczpxxvhvlVf+Qk/ KksooUTrMQgwEA0eD39N7fe3HEkON9Fv7AgpOTP75EfqXTBH0Iga6ubOIaWqg0ONvv8A paWw== X-Gm-Message-State: AHYfb5it7lcjBFKpQpFB5ctDUXu3NZRTN1CDGvNsFqrP7gvU3mrs4l0B KjIqOC5ER6WB1zYedkI= X-Received: by 10.237.41.65 with SMTP id s59mr20722337qtd.223.1502472289040; Fri, 11 Aug 2017 10:24:49 -0700 (PDT) Received: from nn-esharapov-04 ([38.122.176.18]) by smtp.gmail.com with ESMTPSA id 26sm900573qtp.60.2017.08.11.10.24.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Aug 2017 10:24:48 -0700 (PDT) From: evgeniy.sharapov@gmail.com Date: Fri, 11 Aug 2017 13:24:34 -0400 Message-ID: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Fri, 11 Aug 2017 13:54:32 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Having simple init.el file like this (require 'package) (let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) (not (gnutls-available-p)))) (url (concat (if no-ssl "http" "https") "://melpa.org/packages/"))) (add-to-list 'package-archives (cons "melpa" url) t)) (package-initialize) (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (eval-when-compile (require 'use-package)) (use-package company :ensure t :init (setq company-idle-delay 0.1 company-tooltip-limit 20 company-show-numbers t company-selection-wrap-around t company-minimum-prefix-length 2 company-tooltip-align-annotations t company-echo-delay 0) :config ;; default `company-backends' (setq company-backends '(company-capf (company-dabbrev-code company-gtags company-etags company-keywords) company-files company-dabbrev)) (defun ffe-add-company-backends (&rest backends) "Adds BACKENDS to the beginning of the buffer-local version of `company= -backends' list" (set (make-local-variable 'company-backends) (append backends company-backends))) (global-company-mode 1)) (use-package python :defer t :commands python-mode :config (add-hook 'python-mode-hook #'eldoc-mode)) (use-package anaconda-mode :ensure t :init (progn (add-hook 'python-mode-hook #'anaconda-mode) (add-hook 'python-mode-hook #'anaconda-eldoc-mode))) (use-package company-anaconda :defer t :ensure t :init (with-eval-after-load 'company (add-hook 'python-mode-hook (lambda () (ffe-add-company-backends = 'company-anaconda))))) leads to IndentationError once I try to enter multi-line statements in the Inferior python mode.=20 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 If `company-mode' is disabled in the Inferior Python Mode via M-x company-m= ode then entering multi-line statements work as expected. Using C-M-i or `complete-symbol' works.=20 Also at the start of the Inferior Pyhon Mode following Warnings have been shown Warning (python): Python shell prompts cannot be detected. If your emacs session hangs when starting python shells recover with =A1=AEkeyboard-quit=A1=AF and then try fixing the interactive flag for your interpreter by adjusting the =A1=AEpython-shell-interpreter-interactive-arg=A1=AF or add regexps matching shell prompts in the directory-local friendly vars: + =A1=AEpython-shell-prompt-regexp=A1=AF + =A1=AEpython-shell-prompt-block-regexp=A1=AF + =A1=AEpython-shell-prompt-output-regexp=A1=AF Or alternatively in: + =A1=AEpython-shell-prompt-input-regexps=A1=AF + =A1=AEpython-shell-prompt-output-regexps=A1=AF Warning (python): Your =A1=AEpython-shell-interpreter=A1=AF doesn=A1=AFt se= em to support readline, yet =A1=AEpython-shell-completion-native-enable=A1= =AF was t and "python" is not part of the =A1=AEpython-shell-completion-nat= ive-disabled-interpreters=A1=AF list. Native completions have been disable= d locally.=20 Howver at the start it said: 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 Corresponding issue for the `company-mode' on github.com=20 https://github.com/company-mode/company-mode/issues/603 In GNU Emacs 25.2.1 (x86_64-w64-mingw32) of 2017-04-24 built on LAPHROAIG Windowing system distributor 'Microsoft Corp.', version 10.0.14393 Configured using: 'configure --without-dbus --without-compress-install 'CFLAGS=3D-O2 -static -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS Important settings: value of $LANG: ENU locale-coding-system: cp1252 Major mode: Inferior Python Minor modes in effect: shell-dirtrack-mode: t global-company-mode: t override-global-mode: t compilation-shell-minor-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Saving file c:/Users/esharapov/.emacs.d/init.el... Wrote c:/Users/esharapov/.emacs.d/init.el [2 times] For information about GNU Emacs and the GNU system, type C-h C-a. (New file) Can=A1=AFt guess python-indent-offset, using defaults: 4 Shell native completion is disabled, using fallback Company mode disabled in current buffer Mark set Making completion list... Type "q" in help window to restore previous buffer. Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug sendmail eieio-opt speedbar sb-image ezimage dframe tramp-cache company-anaconda pp cus-edit cus-start cus-load wid-edit anaconda-mode derived pythonic f python tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete advice json map dash s company-files company-keywords company-etags company-gtags company-dabbrev-code company-capf tempo warnings ispell etags xref project find-func company-dabbrev company-template company edmacro kmacro tar-mode use-package diminish bind-key easy-mmode cl compile comint ansi-color ring autoload lisp-mnt mm-archive message dired format-spec rfc822 mml mml-sec mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode mail-utils network-stream nsm starttls url-http tls gnutls mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw url-cache url-auth url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs gnus-util mm-util help-fns mail-prsvr password-cache url-vars epg finder-inf package epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote w32notify w32 multi-tty make-network-process emacs) Memory information: ((conses 16 353292 42268) (symbols 56 34067 0) (miscs 48 165 297) (strings 32 68207 11339) (string-bytes 1 1877375) (vectors 16 55331) (vector-slots 8 1659539 79071) (floats 8 320 326) (intervals 56 1115 2875) (buffers 976 70)) From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: Multiline Statement Indentation Error in Inferior Python Mode References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> Resent-From: Evgeniy Sharapov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Aug 2017 18:20: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: To: 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.150247558825429 (code B ref 28051); Fri, 11 Aug 2017 18:20:02 +0000 Received: (at 28051) by debbugs.gnu.org; 11 Aug 2017 18:19:48 +0000 Received: from localhost ([127.0.0.1]:55972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgEXE-0006c5-CA for submit@debbugs.gnu.org; Fri, 11 Aug 2017 14:19:48 -0400 Received: from mail-qt0-f176.google.com ([209.85.216.176]:34288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgEXB-0006bq-3X for 28051@debbugs.gnu.org; Fri, 11 Aug 2017 14:19:46 -0400 Received: by mail-qt0-f176.google.com with SMTP id s6so25644691qtc.1 for <28051@debbugs.gnu.org>; Fri, 11 Aug 2017 11:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xMFGXZ/hfDXtFR660AsvJK40neeDsGXUE6hjCrUFP38=; b=DFwIZxtqvOfHVtfqNuJ0BaL38x8/EU4yAv6Kmgrx9e84Z9JVU+iIrfiZWwWBDODVsR WNZo6jQE6JLaSWWcYrj9+jgybCVdJLtZYFXetFXo+09T7fOw3w9CkZHGfyHtT/v6ajzS H1UlTWcclZhyN5vHow/Y/hw+Rh3+nnY/ELO2ZDkuDqD5FBl8dFIwmM41BxuZRMHramb6 n5hGgiM0EeJM4zpnkILkFtrjVRopErH6HC9FBdLQx58ED+eaePvQYbPEsOIFIzdnd2At lLc186ClZDtAuD+ysHYai1wY0Fm8vFIhyvATm4OYB8TzICLEkR3/I7qEuTigozOCC5bZ JkaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xMFGXZ/hfDXtFR660AsvJK40neeDsGXUE6hjCrUFP38=; b=SKs8KM1xfNgpX/PX6w6BxQXbAACKuWR9CO3pkBpC57h7mnTdrkzLsIp0MiVhIWbDGH NpEB+UaD6MdvIxT+F718lp4nzsVmPtzyauhme+Gg+0tK6wTYt/UjUtUmJ9lomel07vnf 6g5DMQY5COmyrnP9/p8c2oJ0oNGx7Or5w7n9hiRzq0C3ZTix2lPsFWo9WUEtdU4TLHJV uVAYwicavBHZWnQ9j87Evn4h5gYO433YedaouTDnYdGpEbgnAaSAVEg89ZN26td3MAbi HFXoifXHMt9iRvCbnew+um0v+SEo+GykPcBotAeV2hR5c2ekHlCZokUZkpxatBpCJpG9 8UBA== X-Gm-Message-State: AHYfb5jgZ3MIzLMBA1g3OfE2Gf7rk9GuqBClwMt4dtKMHWnP4IV/hXmd 3Yl9hg29a0+vXOSxJW1uffgXbMYNw5BFaWg= X-Received: by 10.200.37.110 with SMTP id 43mr23219801qtn.10.1502475579106; Fri, 11 Aug 2017 11:19:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.42.123 with HTTP; Fri, 11 Aug 2017 11:19:18 -0700 (PDT) From: Evgeniy Sharapov Date: Fri, 11 Aug 2017 14:19:18 -0400 Message-ID: Content-Type: multipart/alternative; boundary="001a114047ce2d2ce105567e5bed" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) --001a114047ce2d2ce105567e5bed Content-Type: text/plain; charset="UTF-8" Reproducing this bug with plain Emacs 1. Start emacs without any .emacs or .emacs.d/init.el files 2. Start Inferior python mode by M-x run-python 3. Enter first line of multi-line statement, press Enter and then start entering second line >>> for x in range(10): ...pri 4. Now press C-M-i, it will complete it to `print`, then enter x so the second line looks like ... print x 5. Now press Enter instead of a ... prompt you should get an error >>> for x in range(10): ... print x File "", line 1 print x ^ IndentationError: unexpected indent >>> ========================================== Evgeniy N. Sharapov Phone: (630) - 779 - 3208 --001a114047ce2d2ce105567e5bed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Reproducing this bug with plain Emacs

<= /div>
1. Start emacs without any .emacs or .emacs.d/init.el files=C2=A0=
2. Start Inferior python mode by M-x run-python
3. Ent= er first line of multi-line statement, press Enter and then start entering = second line

>>> for x in range(10):<RE= T>
...<TAB>pri

4. Now press C-M= -i, it will complete it to `print`, then enter x so the second line looks l= ike=C2=A0

... =C2=A0 =C2=A0 print x

=
5. Now press Enter

instead of a ... pro= mpt you should get an error=C2=A0


<= div>>>> for x in range(10):
... =C2=A0 =C2=A0 print x
=C2=A0 File "<stdin>", line 1
=C2=A0 =C2= =A0 print x
=C2=A0 =C2=A0 ^
IndentationError: unexpecte= d indent
>>>=C2=A0



=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
--001a114047ce2d2ce105567e5bed-- From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: Multiline Statement Indentation Error in Inferior Python Mode Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Aug 2017 17:51:01 +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: To: Evgeniy Sharapov Cc: 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.150256024416737 (code B ref 28051); Sat, 12 Aug 2017 17:51:01 +0000 Received: (at 28051) by debbugs.gnu.org; 12 Aug 2017 17:50:44 +0000 Received: from localhost ([127.0.0.1]:57426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgaYc-0004Lt-F1 for submit@debbugs.gnu.org; Sat, 12 Aug 2017 13:50:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37315) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgaYa-0004Ln-Oh for 28051@debbugs.gnu.org; Sat, 12 Aug 2017 13:50:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgaYU-0006ol-K9 for 28051@debbugs.gnu.org; Sat, 12 Aug 2017 13:50:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgaYQ-0006no-AB; Sat, 12 Aug 2017 13:50:30 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1dgaYP-0007dd-Rj; Sat, 12 Aug 2017 13:50:29 -0400 From: Glenn Morris References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> X-Spook: Human to Animal explosion enigma New World Order Exon X-Ran: Z(y'Y`J)q)e0ABpiX>lD+pDI'$}9NQ7yPT4+A~)q.%$s9{#U&DHAk^O`fS6Zj{^rFr[OUK X-Hue: red X-Attribution: GM Date: Sat, 12 Aug 2017 13:50:29 -0400 In-Reply-To: (Evgeniy Sharapov's message of "Fri, 11 Aug 2017 14:19:18 -0400") Message-ID: <5wshgwfzfe.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Evgeniy Sharapov wrote: > 1. Start emacs without any .emacs or .emacs.d/init.el files emacs -Q is better > 2. Start Inferior python mode by M-x run-python > 3. Enter first line of multi-line statement, press Enter and then start > entering second line > >>>> for x in range(10): > ...pri > > 4. Now press C-M-i, it will complete it to `print`, then enter x so the > second line looks like > > ... print x > > 5. Now press Enter > > instead of a ... prompt you should get an error Works fine for me. Python 2.7.13 on Debian, Python 2.7.5 on RHEL 7. From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: Multiline Statement Indentation Error in Inferior Python Mode Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Aug 2017 00:05: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: To: Glenn Morris Cc: Evgeniy Sharapov , 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.15027554537958 (code B ref 28051); Tue, 15 Aug 2017 00:05:02 +0000 Received: (at 28051) by debbugs.gnu.org; 15 Aug 2017 00:04:13 +0000 Received: from localhost ([127.0.0.1]:37512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhPLB-00024D-LH for submit@debbugs.gnu.org; Mon, 14 Aug 2017 20:04:13 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:38409) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhPL9-000242-3c; Mon, 14 Aug 2017 20:04:11 -0400 Received: by mail-it0-f50.google.com with SMTP id m34so2781174iti.1; Mon, 14 Aug 2017 17:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=LKH30FMGqRvlJhqUeXTB0Lwn3DwayVDBFZZqaDC8rv8=; b=ClV6oKkOr1CasAbe9aOHS6MDDCuwNI/O3s7ue7wsTN6wH9HaiZVDd8B0za//QTIJ2N YfpoCkyfo61a7wY8tZmRaHY3ZgubRq/x4n9aqQ7iq6HIyoyNy16wCJta0eny9nuyRpj8 Qm/0VETT35bPlgb4YcD/S1lxVtz3CSyeyeU/XAATp5FEp7PLaUB6Ihy3KMmtiCm4xPJQ NqyL8iw7rnNTKhSHayoi4AaPb9wBa2BYbjstullTJY9jevZaBv4LbRmWBtWzpWs8asfL nasjK5p4p2X8D2DfXG07BKV8PpKzZaIukKRdJJiekZp4zTZPQ+/h6D/UGRLmLaXwonmt mIfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=LKH30FMGqRvlJhqUeXTB0Lwn3DwayVDBFZZqaDC8rv8=; b=Yw4o42OePQ5fnmyyzFSZ2cuTc0paHp3cnbEYYHbpvbkMHj/UOcthvuyxM/2W/tMOEz kM4ol5XLfKZzELMVANkkuxhyij/zkt93YIGdUd8YnFkrFBah7mDzldj3RtrjnXDfN28q colBJwbmuBd4QxLs5w+2XJ3EpYhZucGyBM4+rNIeEj5PPBP55cdNoMXHVLJoTAQEwkWA +7vXYMpkVaKPrm0s2coHvX0KGI+YZdHnHdO8l5v6LK3NeAOyjE18Zyv7F0x5Pxntca7p ukftiJgiBVvQVB8479wkUkY/iwM4ssv0rWww/sclw+ZuZJxmu5nkwx1B54ZPGPPm0LHS onMQ== X-Gm-Message-State: AHYfb5iOkjeFEXYC3SmOmAvgfwm+8QTpqeXaV/BKCrwkg990pMohCtQg xjTO1JiE37AHEhhB X-Received: by 10.36.78.12 with SMTP id r12mr621850ita.132.1502755047752; Mon, 14 Aug 2017 16:57:27 -0700 (PDT) Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id 63sm3885178ith.4.2017.08.14.16.57.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Aug 2017 16:57:27 -0700 (PDT) From: npostavs@users.sourceforge.net References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> <5wshgwfzfe.fsf@fencepost.gnu.org> Date: Mon, 14 Aug 2017 19:59:05 -0400 In-Reply-To: <5wshgwfzfe.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sat, 12 Aug 2017 13:50:29 -0400") Message-ID: <87y3qlzoom.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) retitle 28051 [w32 / python "legacy" completion] Multiline Statement Indentation Error tags 28051 + confirmed quit Glenn Morris writes: > Works fine for me. Python 2.7.13 on Debian, Python 2.7.5 on RHEL 7. I can reproduce this on Windows. And on GNU/Linux after doing (setq python-shell-completion-native-enable nil). Perhaps this is one of the "limitations" referred to in the comments of python.el: ;; ...the "fallback" or "legacy" mechanism works by executing Python ;; code in the background and enables auto-completion for shells ;; that do not support receiving escape sequences (with some ;; limitations, i.e. completion in blocks does not work). From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: 25.2; Multiline Statement Indentation Error in Inferior Python Mode Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Aug 2017 14:44:01 +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: confirmed To: evgeniy.sharapov@gmail.com Cc: 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.150315382712151 (code B ref 28051); Sat, 19 Aug 2017 14:44:01 +0000 Received: (at 28051) by debbugs.gnu.org; 19 Aug 2017 14:43:47 +0000 Received: from localhost ([127.0.0.1]:45730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dj4yY-00039v-Pp for submit@debbugs.gnu.org; Sat, 19 Aug 2017 10:43:46 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:33396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dj4yW-00039h-Ol for 28051@debbugs.gnu.org; Sat, 19 Aug 2017 10:43:45 -0400 Received: by mail-it0-f50.google.com with SMTP id o72so4578791ita.0 for <28051@debbugs.gnu.org>; Sat, 19 Aug 2017 07:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jJM0OUlLBHS95FGWGF76MlNa/l/Tg/3ZDDOScC5utMA=; b=h+bkq0ARQ59WtORleh2A8L9I9b0WXnxCHHfZQnOFaHowNPNrL2Tfi2AmGb2kFNSZDq dyYBn8N6xE1LZK+5QTgQ+ahen5aLYpYpbLCvJjs2OXrn6Jcr+xCFbOvEYlD4OOTqCp15 INZ35oyaTgWrBj1at35PQSrqiimWKcG53GBBTSc0pGpIbKC+MTMbSShodKZ2uuqgcU2e XDK8OYG3ErszgMcN55vYsOVLYBSyLuN9IO7+UqlzD3HjlxNmPqAUxcS5GOeBlkSZiQfP 2E/tpLRC85QkJzexEO1IksmySuwDwVSOurKEu/d4oyOIpp9Ax/Di1Z4Uxt3mWHHBzFDt zh4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=jJM0OUlLBHS95FGWGF76MlNa/l/Tg/3ZDDOScC5utMA=; b=bPSeUn+IxPSjpYnuVTjAkhQxbLdqWxtLxRxfrSM1KKeAbnYN8b+gKQionlYr0esZAE 8kYGeOe65lWfj4/DlCXCEiuElkYmo8OQ+TqVMdffjYmpTBcCRPAJm2KmxlZUWhvU+ZNT UDwQvuLvl7pC1Dau9tcER8FXRB1ykObegy96R+oyiGDTq77ma+5OWF45YgAy0OYfdVJT loeH0oNDAWHpXG/ZA/ghmDnzZj1S8//129uWkfcYovBXvQgeQkYpcsPAklQnf+iztrto wvvOC7cyF/9pwjyzhdEjhu3jRejNgc0/f0b1HRYD2PAHusCv7soIC9WL/5KbBsQhvFkp rwLg== X-Gm-Message-State: AHYfb5gFIIb4y34Vjcb3ggXT4oL/+4bsQoKDXcZicVUTT1u24jaE7vNc ABjZz0QhtEx6jyLQ X-Received: by 10.36.207.70 with SMTP id y67mr1328835itf.128.1503153818913; Sat, 19 Aug 2017 07:43:38 -0700 (PDT) Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id g200sm123964itb.3.2017.08.19.07.43.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Aug 2017 07:43:36 -0700 (PDT) From: npostavs@users.sourceforge.net References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> Date: Sat, 19 Aug 2017 10:45:13 -0400 In-Reply-To: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> (evgeniy sharapov's message of "Fri, 11 Aug 2017 13:24:34 -0400") Message-ID: <87o9rby5ty.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 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. From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: Multiline Statement Indentation Error in Inferior Python Mode Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Aug 2017 12:17:01 +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: confirmed To: Glenn Morris Cc: Evgeniy Sharapov , 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.150331777212712 (code B ref 28051); Mon, 21 Aug 2017 12:17:01 +0000 Received: (at 28051) by debbugs.gnu.org; 21 Aug 2017 12:16:12 +0000 Received: from localhost ([127.0.0.1]:47378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djlcp-0003It-KK for submit@debbugs.gnu.org; Mon, 21 Aug 2017 08:16:11 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:36001) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djlcn-0003Ic-TB; Mon, 21 Aug 2017 08:16:10 -0400 Received: by mail-it0-f44.google.com with SMTP id 77so31021533itj.1; Mon, 21 Aug 2017 05:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=lw5+p9OskprVx8O+hpHeVG2pCanMgfs26+8W71tscXM=; b=LDixZsoHh733YmItC6RwSAl45ZtPrT0GCbc5N09rzrhVujDAhhf/SfobY4H/qK9fjA idmrAQzgSDawqdClnsju9ObozijI3Ct4W9g9J311VuiVtgsKnuBZrXKTYCjz+YRNv8vl DQHDucK0iQt0CVE1p3UvvN7WGv0sEIXTEe8Y9I/rz5WB54dJB/y0ZNPAA9136VuMXb1t OBOl80vEL1Kp1GPF/j+RRmbhaMbvUyZ43OgUVlHf465O5BbzR5NghjUJSKj+jBElUsfQ 6M/tzDUfvRQvM5mxLIwTnIzKA6ASEH3vfHGPyyn0HZSVsPOOEg8KNe7h5lhy7SJFFLeM g6eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=lw5+p9OskprVx8O+hpHeVG2pCanMgfs26+8W71tscXM=; b=J6RTOuzSLXtaDiJJJZm8TR6gA1wFa+/DVQ6ghj9aKkt69liefIZt25teZwnc29QRRZ DKBADb6OtukkszOVza+6mglqL4jmZSPH9TjP4kc7k6mqJz7QwmgbfbYPbKH4Lo27cJTb OkOalRZYBulej1VwIKPokN8BN9YyE988YBnV43I8R/5zr0XBOfhNgNloUVGaWeO+1WHy /qwyqGsP8kWc3yL7uVO23KT/ng9zdleouQgpK5JlQnQtVGq0rEvHY3jTTUH25JYc7l+V nfuKV2uFH6OcKRRiPvEiTmjwRKTzmA4yRcrgCjtC/vqzozV+ILZwYS9jZ/HmCMQ4YqcQ D4Cw== X-Gm-Message-State: AHYfb5hPqGVnXwnsiWJM68R7LwtcJfZ5EmLJglSctd3O03d8XBxMNf3P K1ZiIreZUXSlWSyJ X-Received: by 10.36.51.2 with SMTP id k2mr5891417itk.155.1503317764118; Mon, 21 Aug 2017 05:16:04 -0700 (PDT) Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id g75sm77197ita.4.2017.08.21.05.16.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Aug 2017 05:16:02 -0700 (PDT) From: npostavs@users.sourceforge.net References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> <5wshgwfzfe.fsf@fencepost.gnu.org> <87y3qlzoom.fsf@users.sourceforge.net> Date: Mon, 21 Aug 2017 08:17:41 -0400 In-Reply-To: <87y3qlzoom.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Mon, 14 Aug 2017 19:59:05 -0400") Message-ID: <87shglazdm.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --=-=-= Content-Type: text/plain tags 28051 + patch quit npostavs@users.sourceforge.net writes: > I can reproduce this on Windows. And on GNU/Linux after doing (setq > python-shell-completion-native-enable nil). Perhaps this is one of the > "limitations" referred to in the comments of python.el: > > ;; ...the "fallback" or "legacy" mechanism works by executing Python > ;; code in the background and enables auto-completion for shells > ;; that do not support receiving escape sequences (with some > ;; limitations, i.e. completion in blocks does not work). I think the best we can do is disable completion with an error message when the prompt is "...", see attached. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Disable-completion-while-entering-python-multiline-s.patch Content-Description: patch >From 20693abb64a342255a076645b758590373308a52 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 19 Aug 2017 11:45:07 -0400 Subject: [PATCH] Disable completion while entering python multiline statements The "legacy" completion mechanism sends newlines to the running python process to get the list of completions, which confuses things if the user is in the middle of entering a multiline statement (Bug#28051). It's better to disable completion in this case. * lisp/progmodes/python.el (python-shell--block-prompt): New variable. (python-shell-prompt-set-calculated-regexps): Set it. (python-shell-completion-at-point): Bail out with error message if current prompt is a block prompt. --- lisp/progmodes/python.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b8f8ed2a06..897ee856a5 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2212,6 +2212,11 @@ python-shell--prompt-calculated-input-regexp Do not set this variable directly, instead use `python-shell-prompt-set-calculated-regexps'.") +(defvar python-shell--block-prompt nil + "Input block prompt for inferior python shell. +Do not set this variable directly, instead use +`python-shell-prompt-set-calculated-regexps'.") + (defvar python-shell--prompt-calculated-output-regexp nil "Calculated output prompt regexp for inferior python shell. Do not set this variable directly, instead use @@ -2366,6 +2371,7 @@ python-shell-prompt-set-calculated-regexps (dolist (prompt (butlast detected-prompts)) (setq prompt (regexp-quote prompt)) (cl-pushnew prompt input-prompts :test #'string=)) + (setq python-shell--block-prompt (nth 1 detected-prompts)) (cl-pushnew (regexp-quote (car (last detected-prompts))) output-prompts :test #'string=)) @@ -2726,6 +2732,7 @@ inferior-python-mode (set (make-local-variable 'python-shell-interpreter-args) (or python-shell--interpreter-args python-shell-interpreter-args)) (set (make-local-variable 'python-shell--prompt-calculated-input-regexp) nil) + (set (make-local-variable 'python-shell--block-prompt) nil) (set (make-local-variable 'python-shell--prompt-calculated-output-regexp) nil) (python-shell-prompt-set-calculated-regexps) (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp) @@ -3632,7 +3639,9 @@ python-shell-completion-at-point ;; Also, since pdb interaction is single-line ;; based, this is enough. (string-match-p python-shell-prompt-pdb-regexp prompt)) - #'python-shell-completion-get-completions) + (if (equal python-shell--block-prompt prompt) + (user-error "Cannot use standard completion in multiline statement") + #'python-shell-completion-get-completions)) (t #'python-shell-completion-native-get-completions))))) (list start end (completion-table-dynamic -- 2.14.1 --=-=-=-- From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: Multiline Statement Indentation Error in Inferior Python Mode Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Aug 2017 01:35: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 To: Dmitry Gutov Cc: Glenn Morris , Evgeniy Sharapov , 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.15033656908816 (code B ref 28051); Tue, 22 Aug 2017 01:35:02 +0000 Received: (at 28051) by debbugs.gnu.org; 22 Aug 2017 01:34:50 +0000 Received: from localhost ([127.0.0.1]:48406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djy5h-0002I7-Pq for submit@debbugs.gnu.org; Mon, 21 Aug 2017 21:34:49 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:33231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djy5g-0002Hu-4P for 28051@debbugs.gnu.org; Mon, 21 Aug 2017 21:34:48 -0400 Received: by mail-it0-f50.google.com with SMTP id n5so3346288itb.0 for <28051@debbugs.gnu.org>; Mon, 21 Aug 2017 18:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=lfh8wpekTtkKXHAsYv5s1qa1FIW9I2JujZQG5h3O0d4=; b=qyj1pXVHhCzKVPazllI+qpZb0kMdZzIidiA93+IS8AgM0NBRygqhy8VeME1xMz9gUj mdFI0PkJm/6GU+t4z+n2WHe2fSVNcxs6OMFmcLsLYAaL7o8NeC6AizbmRFyw7jNcMKLh x3FqvVCD+n1ERplorlgjO0YAAYjHgPpcEA5oH5nwAeaqYDDkMVDSIobnEIfYspmuILM6 n3TlykAXYnd6NBJOYbk9wcvvDVezBk16WjynBVSa43imee0LcaO/UH82bQo5gdmGTjb+ 4mOP4LyGgUG8RpGSUmuyZCEron9YtPJAOVhn8Eh1JQpvZ4d6RnVTjtjtjmFGWE1u1AFY eA+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=lfh8wpekTtkKXHAsYv5s1qa1FIW9I2JujZQG5h3O0d4=; b=D5EcrV4V66FkMgCobilDzpxzdDiXlfYlDcAsj3hYuCcQpq0zrtZEQdycAHfPFSHjs6 1lZUfdb9lSaLd+vvIS5nZub+xJc6R6nJr8ocYXIqEIwHCJJBsurdsU3xxPxXmcwX5AzS tehY4hgOy1QCUm/Sbz6+o3AvXQNrHDe1Yl5Mq9OJx5IuCrwuVhElAomyPkLMyzrX5WKv AIv3jxJS/jA+yBF2bFsu8OlifWrQXnTAeH8+YHHK6TsKHIgW3vmknYreoB22pFiphdUQ QLCq0BcnagZChtc7WPIeX9O80jp2SlxFOHPP3U6cOR3ilx/JSlaQ80ub8LFOFS+PQmK9 CnnQ== X-Gm-Message-State: AHYfb5i/Ypd84d2RcW/wIraZlG22sl/6U6aR8wWiiLLtWBTGZ83ydo8o MiyJBylRzC1VEw== X-Received: by 10.36.196.67 with SMTP id v64mr8742791itf.156.1503365682642; Mon, 21 Aug 2017 18:34:42 -0700 (PDT) Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id w134sm725476ita.0.2017.08.21.18.34.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Aug 2017 18:34:41 -0700 (PDT) From: npostavs@users.sourceforge.net References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> <5wshgwfzfe.fsf@fencepost.gnu.org> <87y3qlzoom.fsf@users.sourceforge.net> <87shglazdm.fsf@users.sourceforge.net> Date: Mon, 21 Aug 2017 21:36:20 -0400 In-Reply-To: <87shglazdm.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Mon, 21 Aug 2017 08:17:41 -0400") Message-ID: <87fuckbcyz.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) npostavs@users.sourceforge.net writes: >> I can reproduce this on Windows. And on GNU/Linux after doing (setq >> python-shell-completion-native-enable nil). Perhaps this is one of the >> "limitations" referred to in the comments of python.el: >> >> ;; ...the "fallback" or "legacy" mechanism works by executing Python >> ;; code in the background and enables auto-completion for shells >> ;; that do not support receiving escape sequences (with some >> ;; limitations, i.e. completion in blocks does not work). > > I think the best we can do is disable completion with an error message > when the prompt is "..." > @@ -3632,7 +3639,9 @@ python-shell-completion-at-point > ;; Also, since pdb interaction is single-line > ;; based, this is enough. > (string-match-p python-shell-prompt-pdb-regexp prompt)) > - #'python-shell-completion-get-completions) > + (if (equal python-shell--block-prompt prompt) > + (user-error "Cannot use standard completion in multiline statement") > + #'python-shell-completion-get-completions)) > (t #'python-shell-completion-native-get-completions))))) Hmm, when using company-mode the error message is sent repeatedly, which seems pretty annoying. But silently returning no matches could be confusing. Dimitri, any advice? From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: 25.2; Multiline Statement Indentation Error in Inferior Python Mode 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 To: npostavs@users.sourceforge.net Cc: 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.15036294564825 (code B ref 28051); Fri, 25 Aug 2017 02:51:02 +0000 Received: (at 28051) by debbugs.gnu.org; 25 Aug 2017 02:50:56 +0000 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 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 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) MIME-Version: 1.0 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> References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> <87o9rby5ty.fsf@users.sourceforge.net> From: Evgeniy Sharapov Date: Thu, 24 Aug 2017 22:50:28 -0400 Message-ID: Content-Type: multipart/alternative; boundary="001a114e521e2dd9d805578b0356" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --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-- From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: 25.2; Multiline Statement Indentation Error in Inferior Python Mode Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2017 12:19: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 To: Evgeniy Sharapov Cc: 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.150366354230000 (code B ref 28051); Fri, 25 Aug 2017 12:19:02 +0000 Received: (at 28051) by debbugs.gnu.org; 25 Aug 2017 12:19:02 +0000 Received: from localhost ([127.0.0.1]:53780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlDZl-0007nk-TH for submit@debbugs.gnu.org; Fri, 25 Aug 2017 08:19:02 -0400 Received: from mail-it0-f41.google.com ([209.85.214.41]:34965) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlDZk-0007nT-7b for 28051@debbugs.gnu.org; Fri, 25 Aug 2017 08:19:00 -0400 Received: by mail-it0-f41.google.com with SMTP id f1so645959ith.0 for <28051@debbugs.gnu.org>; Fri, 25 Aug 2017 05:19:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vxK2voV/4nQ1cgL/z/tRJ5ZHORr4UlePFlhSTrVBWDw=; b=DPGm10AloJHzUP2BFTBAdUUHhLqUCcpJvXUk8OPQK16iBkbl9na9aPe1FDtRBbm41H CvpJxn17PcXkkEKnRuj4bqWrUZzCUqrrzRRzmv23I7eS7g9wq291eHR680S+7kglCoJQ Oy2/HJPt12BHs+TP2EicThF//XgQ6wi3tl+sWcrsAeY1GHhsP5YJC0rK0Ns7OkbCzAdb 5LJe/IetARC4zl2HaGgxUao5Z7yEs7M6E86TlTJry67HGss+H+Bf42TuCP7Ne0cgQ7Zi xPEVWQBlaISjpaQDo43y+fcaow6HuVJkBDbFcUi13OnZ81LqKw//eN7nL2gktZRQonRO Abpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=vxK2voV/4nQ1cgL/z/tRJ5ZHORr4UlePFlhSTrVBWDw=; b=m9vtim0nptSscFQgNIIjdAtYtzk0m866g9Cmdxl6kjoYGXnYk/Be92SzV0mV3PdJYd 4ba3WjsapD+ZAo0gtGVyAG26E1YMFaU5LHe6Y00KjVoD7IFUaDyX2doQ4HfOFjHyrjLS MmmTvJk3cey299YJFFBjydLcFLSMKaDKHfcgCdf7Cy56K+kt/O1mTT2ojsGBwCBsQXss 6obHOcfJeFScr4AXSPMYElxzyZkf2XQt+6jYtCnEL01TETVN75+TGIucIuZ+eFDt0vyw nhr2t8/Y0wRlJgUJyK/t9l5FBu+L8GqRxNJ6gSRmuDSgWKCG5sv+NoHn5KKUXcjPELYL B3Cw== X-Gm-Message-State: AHYfb5juUSb7kWOFDXDVGu0MLwGzqFVzbb+2RsOmAr3snCTQVIXI5Q6+ 1mf57ISQD9QjJ7Kz X-Received: by 10.36.69.11 with SMTP id y11mr1793804ita.158.1503663534508; Fri, 25 Aug 2017 05:18:54 -0700 (PDT) Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id z140sm635877itb.30.2017.08.25.05.18.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Aug 2017 05:18:53 -0700 (PDT) From: npostavs@users.sourceforge.net References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> <87o9rby5ty.fsf@users.sourceforge.net> Date: Fri, 25 Aug 2017 08:20:33 -0400 In-Reply-To: (Evgeniy Sharapov's message of "Thu, 24 Aug 2017 22:50:28 -0400") Message-ID: <87a82nalf2.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) Evgeniy Sharapov writes: > 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. Ah, this is Bug#21376, you could try applying the patch at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21376#11. > Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 Alternatively, since that bug appers to only occur with Python 2, you could try using Python 3 instead. From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: Multiline Statement Indentation Error in Inferior Python Mode Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Aug 2017 16:43: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 To: npostavs@users.sourceforge.net Cc: Glenn Morris , Evgeniy Sharapov , 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.15038521738192 (code B ref 28051); Sun, 27 Aug 2017 16:43:02 +0000 Received: (at 28051) by debbugs.gnu.org; 27 Aug 2017 16:42:53 +0000 Received: from localhost ([127.0.0.1]:58027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dm0eD-000284-0K for submit@debbugs.gnu.org; Sun, 27 Aug 2017 12:42:53 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:37778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dm0eB-00027q-9n for 28051@debbugs.gnu.org; Sun, 27 Aug 2017 12:42:51 -0400 Received: by mail-lf0-f43.google.com with SMTP id c189so5147286lfe.4 for <28051@debbugs.gnu.org>; Sun, 27 Aug 2017 09:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=E68GaQ6ID//DHitmlOo9Co8hmFxhxLLHXZ9yXL6lNDE=; b=g1tyMlpng+FGxi422a2hIyuyju570XgddmEW1hyR6Jlw3+ekTz+1AQPKNOBHm+ymFd G4V4aVm1aezM6K7gewKBO6dNxNe8C/jWW5tK21GW7KtBB/WLIHp82vLwg2eHc1nVCLAK sO4M9TtkyA1z2z2Wn0IL+0+OVRIXUMcE4kbu81J2hvUv0aqZgF0eVUnT0eN3VU1iuo/D mNIrQU1W2UJYknJ7u0TamdtsGqmtShgNrEhuLU8OEYjPOk65GnIwy/NN5KBvFu0+wAou NQt9GefYqTU3il51vlyhZEf9I9N0N+yxtb+1HTGpjLXPgiDWlwLhfRMgUvGFI5hBvSq4 OaUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=E68GaQ6ID//DHitmlOo9Co8hmFxhxLLHXZ9yXL6lNDE=; b=RDp3G0MgoSdFeSTb4pU2tCxk0KCJJxXWt07851/xnD+o/ZYoNE/2XCmrI2VLnrFvDq GuNj5hCkJu0bOSqqI5ABiYbocmfQ7oLPEKnROQAUCrP72INY+6idH0MdMsVyCZVunL8f Hmrxce+pxQUbri0jW6mktezcfXa1bO/yxdPVE+GMujZbT0ZEGAHJIfS9sEb/azkA98qN oT6D+KFTMZXcVjAHLF9X8FQluzW1DIriXCa6j03DXEws1mzkq82g66i9EDLSe/bPD5FK zvF6IW4MKPMif0NNFRCzc/UTWexwOmY7vEStJkGqy8bUcjc1EHw9R7yhFAC2RulPYPv3 IhYg== X-Gm-Message-State: AHYfb5g1XxvQGXblDcz+XUJzag8hDjPhHOva8ewc2klhJFOny7yqiJ+L 7BiYzw6ntn8oYA== X-Received: by 10.25.146.18 with SMTP id u18mr1594048lfd.203.1503852165431; Sun, 27 Aug 2017 09:42:45 -0700 (PDT) Received: from [192.168.1.174] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id 79sm1904000ljf.8.2017.08.27.09.42.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Aug 2017 09:42:44 -0700 (PDT) References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> <5wshgwfzfe.fsf@fencepost.gnu.org> <87y3qlzoom.fsf@users.sourceforge.net> <87shglazdm.fsf@users.sourceforge.net> <87fuckbcyz.fsf@users.sourceforge.net> From: Dmitry Gutov Message-ID: <2e36c178-b365-cc6e-402e-ffc4f01e9c86@yandex.ru> Date: Sun, 27 Aug 2017 19:42:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 MIME-Version: 1.0 In-Reply-To: <87fuckbcyz.fsf@users.sourceforge.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.2 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 8/22/17 4:36 AM, > Hmm, when using company-mode the error message is sent repeatedly, which > seems pretty annoying. But silently returning no matches could be > confusing. Dimitri, any advice? Use a python-specific global variable and only show the warning one time? Or at most once in XX seconds? [...] Content analysis details: (2.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [178.252.127.239 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.43 listed in wl.mailspike.net] 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.215.43 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.215.43 listed in list.dnswl.org] 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (raaahh[at]gmail.com) 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.2 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 8/22/17 4:36 AM, > Hmm, when using company-mode the error message is sent repeatedly, which > seems pretty annoying. But silently returning no matches could be > confusing. Dimitri, any advice? Use a python-specific global variable and only show the warning one time? Or at most once in XX seconds? [...] Content analysis details: (2.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [178.252.127.239 listed in dnsbl.sorbs.net] 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.215.43 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.43 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.215.43 listed in list.dnswl.org] 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dgutov[at]yandex.ru) 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders On 8/22/17 4:36 AM, npostavs@users.sourceforge.net wrote: > Hmm, when using company-mode the error message is sent repeatedly, which > seems pretty annoying. But silently returning no matches could be > confusing. Dimitri, any advice? Use a python-specific global variable and only show the warning one time? Or at most once in XX seconds? There's no existing diagnostic UI for this in company-mode. And the idea for completion-at-point-functions is to not signal errors during normal operation (an error means there's a bug to be fixed, and bugging the user in that case seems okay). In this particular case, though, I'd simply return no completions. We do the same in inf-ruby anyway (no completion on continuation lines). Add a warning message once a session, if you prefer. From unknown Thu Jun 19 16:22:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28051: Multiline Statement Indentation Error in Inferior Python Mode Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Aug 2017 18:28:01 +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 To: Dmitry Gutov Cc: Glenn Morris , Evgeniy Sharapov , 28051@debbugs.gnu.org Received: via spool by 28051-submit@debbugs.gnu.org id=B28051.150385843024513 (code B ref 28051); Sun, 27 Aug 2017 18:28:01 +0000 Received: (at 28051) by debbugs.gnu.org; 27 Aug 2017 18:27:10 +0000 Received: from localhost ([127.0.0.1]:58111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dm2H8-0006NE-EF for submit@debbugs.gnu.org; Sun, 27 Aug 2017 14:27:10 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:38514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dm2H6-0006Mw-Af; Sun, 27 Aug 2017 14:27:08 -0400 Received: by mail-it0-f43.google.com with SMTP id n5so17934782itb.1; Sun, 27 Aug 2017 11:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MNRpR73dP7sK5u0iWkBRAPYAExpK0bXuArfZZ7TxUAM=; b=gkwoxggNoiN41sRC1jWGzYD0g22UEi0qOyX4fVuz0C8mvpdJ+h0bxhFbSaYXWOjP+C Vlt6zfMw8KBVH9x8Vc0zS2QQ49m8CIjCZlK2otU55xqAY1cYtmcBUsTUjkO3dU/s+9GC +DpkKVnZYDEjeOkpQ/6ah8/KEXy1B8U2nggEqWUkKYWNt2AcmAs3P7GpvtSGM9euSPuE ZZQ+clKujmydTS1/CiJq7PVjITNJj78ilUV5IDTLLsHGLPxLvsxPUNLZENEaj0YN6bJt IKDY8xhwdpwScMfRMz+1ZRM3WVxEbwKgvaqCsluUh8cT7HFIDPFb5hjzWvjfVBHGTf3Z 4K2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=MNRpR73dP7sK5u0iWkBRAPYAExpK0bXuArfZZ7TxUAM=; b=e2uS9zt3fR+g4E0nOGiwSD6VYWOy9NVxNXBlmnBBhNf2y5uWNHacEDKK1NlMPVB0q7 ZC7tDIyxrcsVvkLeCLpavC/5CCmlaCTaykB4LAUffsHRrRyzoJny5AKBpmZoakH5lZvy LKreW8ZSuJMsElxr/Y+QuXOJQ0n8gNHrnbPfuHQhgYNGeB1/qukudm5N8cRVWsHxY9Cr BZ16SdMjbcC2v5gg4vTMTIh43HJz7nfjn7mcwaaW3bOoF360kkvIVxvZAQRXO9ExZUki oFXdsArhJ0vkc7ngdmU1AqqpW5dPuo3yjzc3wyaejpTXwzBQlj8JrTnkTB/6tJEkSqRI sW6Q== X-Gm-Message-State: AHYfb5jsnetg8yNMbLVL37K44cag9Cu1pQ3a68f5X7L2DTNNV7jLC2K1 Fb4yyBouhAA5oHNy X-Received: by 10.36.211.211 with SMTP id n202mr4494816itg.147.1503858422672; Sun, 27 Aug 2017 11:27:02 -0700 (PDT) Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id g5sm4992443ioe.14.2017.08.27.11.27.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Aug 2017 11:27:01 -0700 (PDT) From: npostavs@users.sourceforge.net References: <56pwp6ayq3x.fsf@nn-esharapov-04.i-did-not-set--mail-host-address--so-tickle-me> <5wshgwfzfe.fsf@fencepost.gnu.org> <87y3qlzoom.fsf@users.sourceforge.net> <87shglazdm.fsf@users.sourceforge.net> <87fuckbcyz.fsf@users.sourceforge.net> <2e36c178-b365-cc6e-402e-ffc4f01e9c86@yandex.ru> Date: Sun, 27 Aug 2017 14:28:42 -0400 In-Reply-To: <2e36c178-b365-cc6e-402e-ffc4f01e9c86@yandex.ru> (Dmitry Gutov's message of "Sun, 27 Aug 2017 19:42:43 +0300") Message-ID: <87y3q4986d.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) close 28051 26.1 quit Dmitry Gutov writes: > On 8/22/17 4:36 AM, npostavs@users.sourceforge.net wrote: > >> Hmm, when using company-mode the error message is sent repeatedly, which >> seems pretty annoying. But silently returning no matches could be >> confusing. Dimitri, any advice? > > Use a python-specific global variable and only show the warning one > time? Or at most once in XX seconds? > > There's no existing diagnostic UI for this in company-mode. And the > idea for completion-at-point-functions is to not signal errors during > normal operation (an error means there's a bug to be fixed, and > bugging the user in that case seems okay). > > In this particular case, though, I'd simply return no completions. We > do the same in inf-ruby anyway (no completion on continuation > lines). Add a warning message once a session, if you prefer. If it's okay for inf-ruby it's probably okay for python. [1: 5440b238b1]: 2017-08-27 13:46:41 -0400 Disable completion while entering python multiline statements http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=5440b238b1ec4175dd32bc14b4098f6570b2ca85