bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45938: 28.0.50; python native completion fails with fancier readline


From: Lars Ingebrigtsen
Subject: bug#45938: 28.0.50; python native completion fails with fancier readline settings
Date: Tue, 07 Jun 2022 16:05:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Zoltán Vandrus <vandrus.zoltan@gmail.com> writes:

> Three problematic options I found are:
>
>    set colored-stats on
>    set colored-completion-prefix on
>    set enable-bracketed-paste on
>
> With any of these M-x run-python warns:
>
>    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.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

There seems to have been some progress here after this was reported.
The only one of these settings that lead to this warning in Emacs 29 is:

set colored-completion-prefix on

But I'm actually not sure what the commit is that fixed the other cases.
Let's see...

commit a0973fa7a6e8162033abe29084f7b255976c74bc
Author:     Carlos Pita <carlosjosepita@gmail.com>
AuthorDate: Wed Oct 13 21:09:40 2021 -0300
Commit:     Stefan Kangas <stefan@marxist.se>
CommitDate: Fri Nov 5 08:02:31 2021 +0100

    Match dummy output even with non-default rl config
    
    * lisp/progmodes/python.el
    (python-shell-completion-native-get-completions): Match dummy output
    even when readline is configured in non-default ways.  (Bug#51010)

Yes, that's the one -- reverting it makes all of those settings fail,
and not just colored-completion-prefix.

And that's because completion returns:

^[[01;35m0^[[0m^[[K__dummy_completion__  
^[[01;35m1^[[0m^[[K__dummy_completion__  

And without that setting, we get:

0__dummy_completion__  1__dummy_completion__  

So something has to strip ANSI codes here before doing the matching, and
it's not done?

I'm not really that familiar with all this stuff -- anybody know on what
level this should be fixed?  (The code is in
python-shell-completion-native-get-completions.)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]