GNU bug report logs - #41959
Subject: 27.0.91; comint-prompt-regexp in Python mode is incorrect and causes completion failures

Previous Next

Package: emacs;

Reported by: Leo Alekseyev <dnquark <at> gmail.com>

Date: Sat, 20 Jun 2020 01:01:01 UTC

Severity: normal

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41959 in the body.
You can then email your comments to 41959 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41959; Package emacs. (Sat, 20 Jun 2020 01:01:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Alekseyev <dnquark <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 20 Jun 2020 01:01:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Alekseyev <dnquark <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Subject: 27.0.91; comint-prompt-regexp in Python mode is incorrect
 and causes completion failures
Date: Fri, 19 Jun 2020 17:33:54 -0700
M-x run-python brings up a warning buffer with the following message:
Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to
support readline, yet ‘python-shell-completion-native-enable’ was t
and "python" is not part of the
‘python-shell-completion-native-disabled-interpreters’ list.  Native
completions have been disabled locally.

This warning is unwarranted, because the python-shell-interpreter being
invoked in fact supports readline (as can be readily checked via
"import readline, rlcompleter").

Tracing through the code it appears that
python-shell-completion-native-setup erroneously returns nil, because
(python-shell-accept-process-output
              process python-shell-completion-native-try-output-timeout)
returns nil.

This, however, appears to be caused by the fact that the comint prompt
in Python mode is expected to look like ">>> ", which is a bad
assumption. When readline is run with "set show-mode-in-prompt on"
option, the comint prompt will be prefixed with the readline mode
indicator, so it will look like "@>>> ", or "(ins)>>> ", or "+>>> ",
depending on user's configuration (typically in ~/.inputrc).

In short, comint-prompt-regexp assumes a very specific environment, and
when comint prompt fails to match these expectations it causes unrelated
failures in e.g. completion functions.


In GNU Emacs 27.0.91 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2020-06-08 built on meitner
Repository revision: 0260d2d2dbb2607e7310bdb518b7b6c0f58f5f98
Repository branch: emacs-27
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Ubuntu 20.04 LTS

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Waiting for git... [2 times]
Shell native completion is disabled, using fallback
V is undefined
Mark set [2 times]
Mark activated

Configured using:
 'configure --with-sound=alsa --without-gconf --with-mailutils
 --with-json --with-modules --prefix=/usr/local'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL
GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON
PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Special

Minor modes in effect:
  shell-dirtrack-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
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/leo/.emacs.d.doom.27/.local/straight/build/let-alist/let-alist
hides /usr/local/share/emacs/27.0.91/lisp/emacs-lisp/let-alist

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils warnings compile
cl-extra help-mode python tramp-sh tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat shell pcomplete parse-time
iso8601 time-date ls-lisp format-spec comint ring ansi-color finder-inf
package easymenu browse-url url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer 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 composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
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 threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 80485 7435)
 (symbols 48 9871 1)
 (strings 32 29404 1906)
 (string-bytes 1 1053067)
 (vectors 16 15547)
 (vector-slots 8 194915 7402)
 (floats 8 58 12)
 (intervals 56 216 0)
 (buffers 1000 14))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41959; Package emacs. (Mon, 06 Jun 2022 14:20:01 GMT) Full text and rfc822 format available.

Message #8 received at 41959 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Leo Alekseyev <dnquark <at> gmail.com>
Cc: 41959 <at> debbugs.gnu.org
Subject: Re: bug#41959: Subject: 27.0.91; comint-prompt-regexp in Python
 mode is incorrect and causes completion failures
Date: Mon, 06 Jun 2022 16:19:17 +0200
Leo Alekseyev <dnquark <at> gmail.com> writes:

> This, however, appears to be caused by the fact that the comint prompt
> in Python mode is expected to look like ">>> ", which is a bad
> assumption.

To reproduce the problem:

echo set show-mode-in-prompt on >> ~/.inputrc
emacs -Q
M-x run-python

I can reproduce this issue in Emacs 27.1, but not in Emacs 29, so it
looks like this has been fixed now, and I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 41959 <at> debbugs.gnu.org and Leo Alekseyev <dnquark <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 06 Jun 2022 14:20:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 Jul 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 296 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.