From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#68559: [PATCH] Improve Python shell completion Date: Sun, 28 Jan 2024 22:22:11 +0900 Message-ID: References: <83zfx39mcy.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-2022-JP Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10408"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: Eli Zaretskii , 68559@debbugs.gnu.org To: Liu Hui Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 28 14:23:47 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 1rU58U-0002LD-86 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Jan 2024 14:23:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rU57o-0007Sl-Io; Sun, 28 Jan 2024 08:23:04 -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 1rU57l-0007S4-3R for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 08:23:02 -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 1rU57e-00014D-HP for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 08:23:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rU57m-0004dc-5J for bug-gnu-emacs@gnu.org; Sun, 28 Jan 2024 08:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jan 2024 13:23: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.170644815117768 (code B ref 68559); Sun, 28 Jan 2024 13:23:02 +0000 Original-Received: (at 68559) by debbugs.gnu.org; 28 Jan 2024 13:22:31 +0000 Original-Received: from localhost ([127.0.0.1]:56847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU57H-0004cW-1p for submit@debbugs.gnu.org; Sun, 28 Jan 2024 08:22:31 -0500 Original-Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]:51493) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rU57C-0004cF-SX for 68559@debbugs.gnu.org; Sun, 28 Jan 2024 08:22:29 -0500 Original-Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6dd8cba736aso1329464a34.3 for <68559@debbugs.gnu.org>; Sun, 28 Jan 2024 05:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706448133; x=1707052933; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=6kXrcNUysodIwW039+pBaWtH/nLhLyQFGEsxVLbZuW8=; b=gkVH3sQIFzNjlUqxI/oPfulGuFrls8WjKxDumT8xTdKWEWbmo5uRJ+GkHgt++H+Yg4 jXyVhiKXN/qXp9js5CF2uwHDZnKoW32zHZiwvsyFbi8X8fN/VtBQuEqPaQIbFd5AE+fr RngJje8nHz8fVuFXLno19RBeqIixYo/ACHu8vLywWTRzgMhAwaH26kalqIWLFXdRCuWe PJyVth78lDUP6sggP4UzlyY69v2eCeRYw/LOWgYelRd488lOJSEZZXNlktSKFsnj8Err UE1Sh7UFRnFOhYNFMuJ50JoJPNZLCJ6pPZUz09u0sDKyjnU20aqNvb2B805cCvdxZrAG rR3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706448133; x=1707052933; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6kXrcNUysodIwW039+pBaWtH/nLhLyQFGEsxVLbZuW8=; b=IXt71VrFbotnyIbs0hiwxlk/OPpJ0gQo3vYw2oXXWUC6ei/jf8Hd0oI5Wqk7i1jefn 1XQEN90H6EmBYT20n6QVDH1Nr5e6oAA5q2baas6I+a5MRwSV7lvyj4+FzeBqktfOoxFN QAFzLnYSW9Sgp+wKt5KJwul1o3jUsqtiTnDPrnby5Wpq7/fBneoQnNG7yFP0imfcpiSa ZtsnWcH25gek6s73AJk5lBZx4EVfOi24khjkdjSYSJrndq0j2CPJf4bOEkQ0oO030iRM kcYKVYJQQ5p0/VUZqh3n3m6GzHAlYQRWE006yMUzN+G3g2y4yq4MGFFfxHep4tB7Rxkm GTiA== X-Gm-Message-State: AOJu0YwHJqBswvHLUfSvTonSkSceZlyvnHoImvfr6g5+N+jyUPiUtPGq oCx3RX5J1kxjzEa+dJc6eRq80xjUzBTb6twWL/rzHpNDxJUl9twH X-Google-Smtp-Source: AGHT+IEGGlWq0nREa4EcEksmUd9R4/keOeU/TmyAgUSCTP+52qSB3ZuYS4ihh4EtfytvuMap4pnvNw== X-Received: by 2002:a05:6359:4c10:b0:178:68c4:5c2f with SMTP id kj16-20020a0563594c1000b0017868c45c2fmr270955rwc.50.1706448133102; Sun, 28 Jan 2024 05:22:13 -0800 (PST) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id y5-20020a17090a8b0500b002904cba0ffbsm6290066pjn.32.2024.01.28.05.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 05:22:12 -0800 (PST) In-Reply-To: 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:279085 Archived-At: Liu Hui wrote: > kobarity 于2024年1月25日周四 23:38写道: > > 1. Module names cannot be completed in Python buffer. > Can you elaborate? The completion of module names never worked for me > except using IPython with non-native completion mechanism. > > Because module names cannot be completed using vanilla python > interpreter in the terminal, they are also not completed even with the > patch, unless jedi is available. Hmm, I must have done something wrong. I cannot reproduce the problem of module name completion even with the previous patch. As for the current python-mode, I was able to complete the module names because I enabled Jedi in PYTHONSTARTUP. Sorry for the confusion. I'm experiencing strange behavior regarding completion of import statement in a block in Python buffer. If I try to type the following lines and then try to complete it, it will fail. #+begin_src python try: im #+end_src However, when I try to complete at the beginning of the second line: #+begin_src python try: #+end_src "import" keyword also appears as a candidate. If I cancel the candidates and type "im" and try to complete it, it will succeed. This behavior does not occur in Python Shell buffer. Another thing I noticed is the multi-line import statement. If the import statement is one-line, each items (IGNORECASE and MULTILINE in the example below) can be completed. #+begin_src python from re import IGNORECASE, MULTILINE #+end_src However, they cannot be completed if the import statement spans multi-line. #+begin_src python from re import ( IGN #+end_src This happens in both Python buffer and Python Shell buffer. Perhaps this is a limitation of Jedi completer? > > 2. Completion is not working in comments. > > > > I'm not sure if the completion should work in comments, but some > > people might want it because the current python-mode allows it in both > > Python buffer and Python Shell buffer. > > Thanks for pointing it out. The attached patch should now restore > previous basic completion behavior in comments. Thanks, I confirmed that basic completion (without keyword argument completion) can be performed within comments.