From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#68559: [PATCH] Improve Python shell completion Date: Wed, 21 Feb 2024 15:55:31 +0100 Message-ID: <87sf1leujg.fsf@epfl.ch> References: <6BAFD8BF-8F18-4D9F-9DB3-A185AEF2EBCA@gmail.com> <867cj5wuo6.fsf@gnu.org> <865xypwu5e.fsf@gnu.org> <87il2kvbh5.fsf@epfl.ch> <878r3fz37e.fsf@epfl.ch> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22359"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , kobarity@gmail.com, mattias.engdegard@gmail.com, 68559@debbugs.gnu.org To: Liu Hui Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 21 16:44:32 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 1rcolf-0005Hn-S5 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Feb 2024 16:44:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcoab-0000Yy-Aw; Wed, 21 Feb 2024 10:32:53 -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 1rcoPo-0006XF-6J for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 10:21:44 -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 1rco1X-0007PS-Oh for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 09:56:41 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rco1t-0002py-Vl for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 09:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Feb 2024 14:57:01 +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.170852736410861 (code B ref 68559); Wed, 21 Feb 2024 14:57:01 +0000 Original-Received: (at 68559) by debbugs.gnu.org; 21 Feb 2024 14:56:04 +0000 Original-Received: from localhost ([127.0.0.1]:49952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rco0x-0002ox-Mg for submit@debbugs.gnu.org; Wed, 21 Feb 2024 09:56:04 -0500 Original-Received: from mail-ej1-f43.google.com ([209.85.218.43]:39362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rco0v-0002kh-3X for 68559@debbugs.gnu.org; Wed, 21 Feb 2024 09:56:02 -0500 Original-Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a28cfca3c45so240412266b.1 for <68559@debbugs.gnu.org>; Wed, 21 Feb 2024 06:55:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708527333; x=1709132133; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uPEnid1BzKusoPKOD/A+8VxqFgkxfvgT1GcZc/fYhnk=; b=uT0t2J7ArKrRVmUgr3vIZnzy9Er00Ke2+D4nCMToV0YxNcMfz6qPmKELl5n0ISnkm9 aGrcVo9fFLwoI96qjFAcwdHwJGXUxZ5B8DeUuP04E2/f6aa6uCxn4+6M+rwx5h6FJQ9H +E7RPS4wrlU6YHq95E5wD/yEmlbMmS9fsc8STq9CDvB0bkrUlQB042pQley2t0WJH7qf kfQ/GXq76/jaj8Hfj86fuHh7NweahGqZXXqPhW40cy7Ni9JIbjH5emPc+fWuPYLywf6s nC5k56tz6g1EU/MzhkA96pUJr8Mrprrlg1BnZkIKpCeBdx5+ocbqQ6ES+8gP9gPTrLaK ymlw== X-Forwarded-Encrypted: i=1; AJvYcCW5eUQp0kgm9euvP6nswhCCoBfbQsiiCJV52xrklSPyMIWWu55PY8klcF65bbeeNSWzHHMnW1MU9bkpikcZgGD2dR59F2I= X-Gm-Message-State: AOJu0YwIy8NP5xYfUF0Bnuh/GERp8ZbShB7vuoqxSEsHgeCMwyWk/eXA jsDKExuoO8K/dsd9mvbPOtx4x/wrgdfJy5KAxHTDAJiwtV52zckf X-Google-Smtp-Source: AGHT+IHb/+/pBjvAPSrt9nPBKaSNdr7jJH6nZryioAZfJDHghIM7sd2AP33QHzVOtPOSU4oGnnHuTA== X-Received: by 2002:a17:907:779a:b0:a3e:625f:246 with SMTP id ky26-20020a170907779a00b00a3e625f0246mr6753560ejc.3.1708527332600; Wed, 21 Feb 2024 06:55:32 -0800 (PST) Original-Received: from localhost ([2001:620:618:5c0:2:80b3:0:239]) by smtp.gmail.com with ESMTPSA id cu14-20020a170906ba8e00b00a3e553fe352sm4015861ejd.133.2024.02.21.06.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 06:55:32 -0800 (PST) In-Reply-To: (Liu Hui's message of "Wed, 21 Feb 2024 18:00:00 +0800") 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:280395 Archived-At: 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: in particular, python-shell-readline-completer-delims evaluates to "\s\t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?" rather than the empty string. Any idea why that happens? > - (progn > - (run-python nil t) > - (insert ,contents) > - (goto-char (point-min)) > - (python-tests-shell-wait-for-prompt) > - ,@body) > + ;; Prevent test failures when Jedi is used as a completion > + ;; backend, either directly or indirectly (e.g., via > + ;; IPython). Jedi needs to store cache, but the > + ;; "/nonexistent" HOME directory is not writable. > + (ert-with-temp-directory cache-dir ^^^^^^^^^ Should this be an uninterned symbol instead? > + (with-environment-variables (("XDG_CACHE_HOME" cache-dir)) > + (run-python nil t) > + (insert ,contents) > + (goto-char (point-min)) > + (python-tests-shell-wait-for-prompt) > + ,@body)) > (when (python-shell-get-buffer) > (python-shell-with-shell-buffer > (let (kill-buffer-hook kill-buffer-query-functions) Thanks, -- Basil