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: Mon, 29 Jan 2024 22:15:20 +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=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9099"; 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 Mon Jan 29 14:16:19 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 1rURUp-0002AJ-Lh for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Jan 2024 14:16:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rURUT-0004nb-QA; Mon, 29 Jan 2024 08:15:58 -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 1rURUQ-0004nB-Uc for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2024 08:15:54 -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 1rURUQ-0002lE-M4 for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2024 08:15:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rURUY-0003AR-FG for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2024 08:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jan 2024 13:16: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.170653413712130 (code B ref 68559); Mon, 29 Jan 2024 13:16:02 +0000 Original-Received: (at 68559) by debbugs.gnu.org; 29 Jan 2024 13:15:37 +0000 Original-Received: from localhost ([127.0.0.1]:59270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rURU9-00039a-5M for submit@debbugs.gnu.org; Mon, 29 Jan 2024 08:15:37 -0500 Original-Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:53696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rURU6-00039K-Ny for 68559@debbugs.gnu.org; Mon, 29 Jan 2024 08:15:35 -0500 Original-Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-5cdbc4334edso1143185a12.3 for <68559@debbugs.gnu.org>; Mon, 29 Jan 2024 05:15:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706534120; x=1707138920; 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=SFe0VE1P0R830HmXAsCFcjhexR5OOVkfcAcsu4CkfxU=; b=Nm7Tneg7vT1ZU/nBblKvcsS/DehafWYAWpUH9N1NpoIMkux1g7vfvi0RAgacCTpmmf Ev0bcxEb28hK9x5hpZ/WPg8qopoMQB+8Lon3u8HEXuB9QdJrDC/RsTbS9aQrfhPNRrxZ JPCTeMIQ1vnMaLKkA3/13YbfhvYPP//XX3qyl4MWtVQz0V9ffxmqHr/+0cS2a4kilbJE yC4UnRrkA+4boOJsWU2Tz4fitPrmzFbMLEACOC2tNpr/a6hgpGBnHV7edOKxxLs2jjHE X/0FrQ+TF7yorp4+RwPbx7CyBX38kymMknUTMUnh7FibgmgD8fpsCho/j3B5ZeI31F1k mVIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706534120; x=1707138920; 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=SFe0VE1P0R830HmXAsCFcjhexR5OOVkfcAcsu4CkfxU=; b=TVDNagymJd7LBxxloJmyYEEisU3nyT/twflrWxZsN4ctYG8Hq81fMLVEB7FMEMDpoI 0U9pVTQgv/OaZ7x2ssUYCELUZ5XwCdhu1mjiOm3YqFu/C3DDcFOSDw5JDl+XOKA1K9/d ixi93vQ1w180FFXm82y8eK9hMcLpCoVKSTCvkV9l7J3Upmtjfw2hO7Sk1kDh65fmIx9K Xi1tTXoWXCyTXETM5+0T0bUoYHSS+SSPWOWkgf6+4zyL7w8LJZ68hBeel6pGvVVmEdUx 0HWGFQs72K7BC4ShzVdnCinCh14BBlBg2/PVdJIJA40pcDZeXKOtHVCez6uQRCJkaTCC 85BA== X-Gm-Message-State: AOJu0Yw5laDN7fwKqpMWVqrCgp+CzzlRfCuw0Yw/T8sCE+kFfUxM4Ekk oOLAWYaX9Qe5IaZJ853B8E6tW1YGHO+XO++vu/uXY4+8FQuHUlf5 X-Google-Smtp-Source: AGHT+IG4ASC7j7jb2hydd5bftif3Hn7ejim6wNDyxJfjHy8Wz6oc5mnU4AZ08d/QqtywMd8xQCGLPQ== X-Received: by 2002:a17:90a:1307:b0:293:ff02:664d with SMTP id h7-20020a17090a130700b00293ff02664dmr1972583pja.4.1706534120227; Mon, 29 Jan 2024 05:15:20 -0800 (PST) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id d15-20020a17090a498f00b00291000d8210sm8032683pjh.19.2024.01.29.05.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 05:15:19 -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:279129 Archived-At: kobarity wrote: > Liu Hui wrote: > > 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. One additional comment regarding ERT. pyenv installs an ipython shim to the shims directory, if there is at least one virtualenv providing ipython. It can be found by `executable-find'. However, it is not usable unless the virtualenv is activated. As a result, the `python-shell-completion-at-point-ipython' ERT would fail unless a virtualenv which provides ipython is activated. This may be something pyenv users should take care of, but it is more convenient for pyenv users like me to make the following changes. diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index ae23ff8ebe2..9452f136cfb 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -4854,7 +4854,10 @@ python-shell-completion-at-point-ipython "Check if Python shell completion works for IPython." (let ((python-shell-interpreter "ipython") (python-shell-interpreter-args "-i --simple-prompt")) - (skip-unless (executable-find python-shell-interpreter)) + (skip-unless + (and + (executable-find python-shell-interpreter) + (eql (call-process python-shell-interpreter nil nil nil "--version") 0))) (python-tests-with-temp-buffer-with-shell "" (python-shell-with-shell-buffer