GNU bug report logs - #68559
[PATCH] Improve Python shell completion

Previous Next

Package: emacs;

Reported by: Liu Hui <liuhui1610 <at> gmail.com>

Date: Thu, 18 Jan 2024 04:50:01 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: kobarity <kobarity <at> gmail.com>
Cc: Liu Hui <liuhui1610 <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 68559 <at> debbugs.gnu.org
Subject: Re: bug#68559: [PATCH] Improve Python shell completion
Date: Fri, 16 Feb 2024 21:10:15 +0100
16 feb. 2024 kl. 16.24 skrev kobarity <kobarity <at> gmail.com>:

> I made prototype patches for each method.  I don't use Mac so it would
> be helpful if you could try these.

Nice, thank you! I can confirm that they both appear to work, at least in the sense that the python-tests pass (except for the ones skipped intentionally), and the python shell behaves reasonable.

Only the set-tty-mode patch eliminates echo in the interactive python shell; in that sense it's preferable.

Both produce the very annoying warning

  Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native-enable’ was t and "python3" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally. Consider installing the python package "readline".

which is not even correct since the standard Python does have a working readline module, even if it uses libedit.

> 0001-Set-tty-mode-to-raw-when-setting-up-Inferior-Python.patch sets
> the Inferior Python tty to raw mode.  python-ffap-module-path-1 will
> no longer need to be skipped on Mac.

Right, that test runs and passes.

>  If it is safe to set tty to raw
> mode on all UNIX based systems, I prefer this method.

Same here. I see no reason why it wouldn't be safe, either.

> By the way, is it necessary to send
> `python-shell-completion-setup-code' for every completion in
> `python-shell-completion-get-completions'?  To me it seems sufficient
> to send it once at initialization.

Indeed, it does seem a bit extravagant.





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

Previous Next


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