From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Liu Hui Newsgroups: gmane.emacs.bugs Subject: bug#68559: [PATCH] Improve Python shell completion Date: Fri, 23 Feb 2024 21:07:22 +0800 Message-ID: References: <6BAFD8BF-8F18-4D9F-9DB3-A185AEF2EBCA@gmail.com> <867cj5wuo6.fsf@gnu.org> <865xypwu5e.fsf@gnu.org> <87il2kvbh5.fsf@epfl.ch> <878r3fz37e.fsf@epfl.ch> <87sf1leujg.fsf@epfl.ch> <877ciwwqjt.fsf@epfl.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21417"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , kobarity@gmail.com, mattias.engdegard@gmail.com, 68559@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 23 14:12:45 2024 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 1rdVM5-0005OH-0r for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Feb 2024 14:12:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdVLj-0003zt-VJ; Fri, 23 Feb 2024 08:12:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdVJ7-0002So-Fy for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 08:09:42 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdVJ5-00007p-GX for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 08:09:40 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rdVJS-0008Dq-ME for bug-gnu-emacs@gnu.org; Fri, 23 Feb 2024 08:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Liu Hui Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Feb 2024 13:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68559 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68559-submit@debbugs.gnu.org id=B68559.170869374531487 (code B ref 68559); Fri, 23 Feb 2024 13:10:02 +0000 Original-Received: (at 68559) by debbugs.gnu.org; 23 Feb 2024 13:09:05 +0000 Original-Received: from localhost ([127.0.0.1]:37658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdVIW-0008Bl-IV for submit@debbugs.gnu.org; Fri, 23 Feb 2024 08:09:05 -0500 Original-Received: from mail-ot1-f47.google.com ([209.85.210.47]:54769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdVIU-0008B9-KU for 68559@debbugs.gnu.org; Fri, 23 Feb 2024 08:09:03 -0500 Original-Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6e0f43074edso432088a34.1 for <68559@debbugs.gnu.org>; Fri, 23 Feb 2024 05:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708693653; x=1709298453; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yKG6zoJAz7gxK3Ve/jRB61anhjfBH9eJuytL5u7Epyw=; b=Jedl58PFRuf3JvM31gSHcIdqldTwPJ7fqyoCURiMAjx8ybIaf4PP6mGJunJbxCNvbZ 8V3aKedjVVuEVcEj+QiH3wE/qMm/kXgfY5U2zoQNwFGFl65JoQIK0feKbCKKH9W8sCS8 V5IwqtT2eyRM4ckKVp0wIra+tSnhlndM3RH2NQi7djvOBc6rF6rtUz3N/bcb0Nep7wuD DuWOeryC+WjTIPcVsuDtuAX28sKyinJxSLzkc3n8PRe8PmJ+etLJXlPI0TtkkUUQDPM0 OFY1Fo/9Ddm5Ez0U5F0iTBZKx1Mx85AFGTkr3GD+VGp/V5l9ygv65SG/cX28A2isa7EZ E8qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708693653; x=1709298453; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yKG6zoJAz7gxK3Ve/jRB61anhjfBH9eJuytL5u7Epyw=; b=MjT0qGioowo7MBhqz12F00CgzuX4EzI1VyyILCM6xRxUCJ3+bm6k6PPo41HTxsvbi+ +ShT0iSGWSBjqy0GzwQHfZUREb7F8xSPDj5IwHa5VFLTvEK4GVG2F09MS5wP9ferpVDh O8QPhVncMV6dqmk6KjpvOzdecR5T1UeO3j80g6we3sizcpBVb/N6H/pmdofOXtCW+or2 yDnVr6yOHfuKjU0/z6Js8XSmUQpS/TnAHiK0E9UgnZk6+l1/dPfMGCIYh1EQYw5j37LH fDZy6xMfbfF7UWyY9UaS1a6ZQVrg5HoL9bF9WM8pKg/2oCMRkjbZ1DwmEJiV2rTASYGr oh9A== X-Forwarded-Encrypted: i=1; AJvYcCWRJQ8caR8MzQH0x3oHBrmK7KETMDyC+VJGqaQGznsJZrG1YGk9qWq8eVxbzpOctPpXJT3Hycp50jw6HwEK0VE90Aa44Tc= X-Gm-Message-State: AOJu0YxKdFE7Fkja4N8TY9v9F2vLNwd2d82wM8aDmrInuAmNnAuzjT7o GlIqBv6OdFmeJoKLADVBZtxylE63UWEgvkkCgwiMeTIuNHG4tlaKwXc0ASHfEX+4h4fk/+BvYlY 52HfKGF+SoyOpMNti+7UKmHx0EKk= X-Google-Smtp-Source: AGHT+IHXb/FAtusBx6IdpQxMPZ7lvst4U189YfNtbCCq9S8+UTsCBelFXXacID34RbWsrHarcWW3yyFoqHB2UgiqyY8= X-Received: by 2002:a05:6808:d4d:b0:3c0:371d:3504 with SMTP id w13-20020a0568080d4d00b003c0371d3504mr2039926oik.5.1708693653177; Fri, 23 Feb 2024 05:07:33 -0800 (PST) In-Reply-To: <877ciwwqjt.fsf@epfl.ch> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280494 Archived-At: On Thu, Feb 22, 2024 at 9:56=E2=80=AFPM Basil L. Contovounesios wrote: > > Liu Hui [2024-02-22 18:31 +0800] wrote: > > > On Wed, Feb 21, 2024 at 10:55=E2=80=AFPM Basil L. Contovounesios > > wrote: > >> > >> Liu Hui [2024-02-21 18:00 +0800] wrote: > >> > >> > The attached patch should fix the problem. > >> > >> Thanks! The patch fixes the error, but that's because > >> python-shell-completion-at-point-ipython is now skipped: > > > > Only the native completion part is skipped for the reason below. > > > >> in particular, python-shell-readline-completer-delims evaluates to > >> "\s\t\n`~!@#$%^&*()-=3D+[{]}\\|;:'\",<>/?" rather than the empty strin= g. > > > > "\s\t\n`..." is the delimiter used by rlcompleter, which is the > > default completer used by the readline. rlcompleter cannot complete > > module names or parameters, so in this case the native completion part > > is skipped. > > > > The test is intended to be used with Jedi as the completion backend, > > e.g. setting PYTHONSTARTUP=3D"$(python -m jedi repl)", or with a custom > > IPython completer defined in the PYTHONSTARTUP file. I have updated the > > patch to make the test use Jedi when possible. > > Thanks, looks fine to me and runs without issue. > > The python-shell-completion-at-point-ipython test is still skipped, with > or without specifying PYTHONSTARTUP=3D"$(python -m jedi repl)", but like > you suggest that's not necessarily a problem. I have no idea why the test is skipped. You may still check if native completion works for IPython with following steps: 1. PYTHONSTARTUP=3D"$(python -m jedi repl)" emacs -Q 2. start Python shell with IPython interpreter, i.e. (setq python-shell-interpreter "ipython") (setq python-shell-interpreter-args "-i --simple-prompt") M-x run-python There should be text "REPL completion using Jedi xxx" before the first prompt in the Python shell buffer, and a message "Shell native completion is enabled.". 3. type "import ab"/"open(enc" and press TAB expected result: "import abc"/"open(encoding=3D" > I'm guessing you don't have write access to emacs.git, but have signed > the CA? If so, and if there are no other comments/objections in a few > days, I'll apply the patch in your name. Yes, I've signed the CA. Thanks. > Is your GitHub username ilupin by any chance? > > I ask because there is one commit in emacs.git from someone with the > same name as you, but with the email address > ilupin@users.noreply.github.com (I'm guessing the commit was imported > from eglot.git). > > If that was from you, do you have any objection to me mapping > ilupin@users.noreply.github.com to liuhui1610@gmail.com in the .mailmap > file in emacs.git? Then all commits will show up under a single name > and email address. Yes. I have no objection, thanks.