From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#51218: 28.0.60; python.el: Native completion strikes again Date: Sat, 30 Oct 2021 08:53:46 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18358"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 51218@debbugs.gnu.org To: Carlos Pita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 30 17:54:26 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgqgc-0004em-PB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Oct 2021 17:54:26 +0200 Original-Received: from localhost ([::1]:53166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgqga-0000N1-T5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Oct 2021 11:54:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgqgE-0000Mk-4X for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 11:54:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgqgD-0000Xz-SI for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 11:54:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgqgD-00081I-RQ for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 11:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Oct 2021 15:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51218 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51218-submit@debbugs.gnu.org id=B51218.163560923430808 (code B ref 51218); Sat, 30 Oct 2021 15:54:01 +0000 Original-Received: (at 51218) by debbugs.gnu.org; 30 Oct 2021 15:53:54 +0000 Original-Received: from localhost ([127.0.0.1]:58224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgqg5-00080l-OQ for submit@debbugs.gnu.org; Sat, 30 Oct 2021 11:53:54 -0400 Original-Received: from mail-pl1-f182.google.com ([209.85.214.182]:45873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgqg4-00080O-BO for 51218@debbugs.gnu.org; Sat, 30 Oct 2021 11:53:52 -0400 Original-Received: by mail-pl1-f182.google.com with SMTP id f8so8807414plo.12 for <51218@debbugs.gnu.org>; Sat, 30 Oct 2021 08:53:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=cKFjtM51SjRRPyPJuSc5k+AjBI+z7ValVp2D566QA3Q=; b=c+VZg20/1zs2cwh8TpGlsFm++z0f71bVqHVvKk6eSEYJRexIDkXE8zakDXFjrZEfdS VswSibHG6ktSsCZoKJ2P38l9D3iDlPFi2ytiahQMJIOqT0iFr7oeIVIxQw3dPyVrT2PQ CTxyLJf1iEwyWng0GnWig6+JUQH9WVKlKBgl90SDDO8JPBKgaHWY1rALo2Ozn+9CJSi7 KrxLVKg3bQJoxg0ZVO3aDmhL9deShr72Ud+NviKhfaNxEUPXyr6HSXDITk5/mTPuOKen qQHVbVALKvQBaEGzv1oupCuOzN20UnuOhmVFalhvn6MyhhJjTwQ5fpS6i2Awwyql+5Z8 FeBA== X-Gm-Message-State: AOAM531u4F71hEWOlgpiJpgN51u2PPDCNwMvqgvbOb+XxrgUxb7ZXcI1 LHZn950t0DeFVp/D8OEFPA3KTIWHOvkdRO6rT7E= X-Google-Smtp-Source: ABdhPJyx83h5PYDN+zs76ayU4jbSlXPxZR1aZoHCbUVC2GoHsqnV5tHXTq2+s3JSYKVB2cZAr+NgoM9mXHgZB4a2wdg= X-Received: by 2002:a17:902:8c93:b0:141:5442:e608 with SMTP id t19-20020a1709028c9300b001415442e608mr15741019plo.32.1635609226538; Sat, 30 Oct 2021 08:53:46 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 30 Oct 2021 08:53:46 -0700 In-Reply-To: (Carlos Pita's message of "Thu, 14 Oct 2021 21:27:29 -0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218621 Archived-At: close 51218 28.1 thanks Carlos Pita writes: > here's another problem with native completion. If in ~/.inputrc you > customize completion-prefix-display-length to, say, 5, then this won't > work: > > import numpy > numpy. > > while this still works: > > import numpy as np > np. > > The reason is that readline will truncate a prefix of the dummy > completions, throwing something like: > > ...my_completion__[0m[K ...my_completion__[0m[K > > instead of: > > 0__dummy_completion__[0m[K 1__dummy_completion__[0m[K > > I can write a patch passing a different value to > completion-prefix-display-length but this is getting tiresome and I > reiterate my plea for removal of at least the native completion backend. > I argued elsewhere for removal of all automagical stuff that depends on > stdin/out manipulation (i.e. c-a-p and eldoc) but we can start small > removing just the native part for now. Yes, this makes sense, so I have now pushed your below patch to emacs-28 (commit 4a96f32def). Carlos Pita writes: > In any case, here is the patch to toggle that option off. > >>>From a8caf24c7af05d9d1f92f52632cfe7ccefd3f2dd Mon Sep 17 00:00:00 2001 > From: Carlos Pita > Date: Thu, 14 Oct 2021 21:48:43 -0300 > Subject: [PATCH] Avoid replacing common prefix with ellipsis > > * lisp/progmodes/python.el > (python-shell-completion-native-setup): Configure readline not to > suppress common prefixes. > --- > lisp/progmodes/python.el | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > index 54e3789c66..1da7e18635 100644 > --- a/lisp/progmodes/python.el > +++ b/lisp/progmodes/python.el > @@ -3711,6 +3711,8 @@ python-shell-completion-native-setup > readline.parse_and_bind('tab: complete') > # Require just one tab to send output. > readline.parse_and_bind('set show-all-if-ambiguous on') > + # Avoid replacing common prefix with ellipsis. > + readline.parse_and_bind('set completion-prefix-display-length 0') > > print ('python.el: native completion setup loaded') > except: