From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#68559: [PATCH] Improve Python shell completion Date: Fri, 16 Feb 2024 21:10:15 +0100 Message-ID: References: <6BAFD8BF-8F18-4D9F-9DB3-A185AEF2EBCA@gmail.com> <8B4172D0-FC31-4437-99C4-683C892C5F86@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) 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="36483"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Liu Hui , Eli Zaretskii , 68559@debbugs.gnu.org To: kobarity Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 16 21:12:28 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 1rb4ZQ-0009Lh-7z for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Feb 2024 21:12:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rb4Yz-0004lj-7g; Fri, 16 Feb 2024 15:12:01 -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 1rb4Yt-0004jy-FI for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2024 15:11:57 -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 1rb4Yg-0003JM-74 for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2024 15:11:42 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rb4Yz-0006AH-K2 for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2024 15:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Feb 2024 20:12: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.170811430623678 (code B ref 68559); Fri, 16 Feb 2024 20:12:01 +0000 Original-Received: (at 68559) by debbugs.gnu.org; 16 Feb 2024 20:11:46 +0000 Original-Received: from localhost ([127.0.0.1]:60256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rb4Yj-00069q-QE for submit@debbugs.gnu.org; Fri, 16 Feb 2024 15:11:46 -0500 Original-Received: from mail-lf1-f44.google.com ([209.85.167.44]:57644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rb4Yg-00069W-CI for 68559@debbugs.gnu.org; Fri, 16 Feb 2024 15:11:45 -0500 Original-Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5129ece824aso412673e87.3 for <68559@debbugs.gnu.org>; Fri, 16 Feb 2024 12:11:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708114217; x=1708719017; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=9YGRQWzlatLSw0IJ1KY3ktwNz+76KF4Deq09MimUxzk=; b=CUqAExi1tKoEK/hRQMAKCfs7m6pPEtV8HJ0jeSnEippP4aqHUBlT0nK6xM1NVwEFev YPeLmNrp6m690naOs1T5H0oFWRb6MDIEVVjDAftBYvhMjPnP273snIpRrNlYoWMCOzPz 00PDE9jXQsOrIBzMXFHkDppDUG/25vF7VC9VMII1/E0BEjW1UBbpJYDSNAUmSpL4wRRk eLcDzUuDChpv6z5p6++Z+aH6WBE1n5cTLfFwc9SLR3lTX+f9bjBiEQNGzjG2NNBCf7HK FPDo4eVFbsdxeu6zzguTAX07R9YmhWDCRhD64WvFzsmFsVpZqmho44lBHMrXKUELeEsR MY/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708114217; x=1708719017; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=9YGRQWzlatLSw0IJ1KY3ktwNz+76KF4Deq09MimUxzk=; b=VwT8b+axaWev+0Qhjw8YPSTEBRsB4SCqx+/tkFDiXBNUSoVLATg4c7yVjlY5L4FpPB pSC9gksLlSTySx45svS6S0U8zW7nQgr+tveI2PaoJGAXz/FMJVw+EDo/X2KL7U3OJ711 xBEZYjbneumXx6MZA5VWWWLs/5HSoWVhRd01xmq4tfjZvQ4+Xi38AUi5/PgRyYVoz53T y7LHkEM84Lg2BsUPt5k2YPmkDH2F6tuWqDFPYO6OwW0TzqnXhVqmvYn7zc+fM0WW02Xm ncfvrxriwPOscrH9+JqQmBz/w8r1NigWZ2Roi2qDp/wz3fSI/bM7W9UT8V1kuzUrLuJl rNxw== X-Forwarded-Encrypted: i=1; AJvYcCVkSryWWQ4299Ot1mPppg9jMNu+NFTdozSVCKxit7+KqjsGmj/zJVc0AAo7vaqjM0KSPc/XT6T1Rfkyb27+ehm50LYUWaM= X-Gm-Message-State: AOJu0YxGTE4EruH3sOWQUhHgHrBhc+U8IZY6NClmtyk6JRQrPjr/WU0r iUMxDOxrdkr21VqxuYL/M0PkXCAHRPLiix51XOWjkw5tXSx/NO8n X-Google-Smtp-Source: AGHT+IFxEp3SN6B7HVctRP58ogWj/2xnv/ELa4l2p/BWcwD+d+Thw+cmMfn6U1ncOlRBf9oPIPfCEA== X-Received: by 2002:ac2:5f53:0:b0:511:86a2:7ea with SMTP id 19-20020ac25f53000000b0051186a207eamr3590340lfz.33.1708114216731; Fri, 16 Feb 2024 12:10:16 -0800 (PST) Original-Received: from smtpclient.apple (c80-217-1-132.bredband.tele2.se. [80.217.1.132]) by smtp.gmail.com with ESMTPSA id z16-20020a056512371000b005118f924165sm59599lfr.133.2024.02.16.12.10.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2024 12:10:16 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.15) 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:280106 Archived-At: 16 feb. 2024 kl. 16.24 skrev kobarity : > I made prototype patches for each method. I don't use Mac so it would > be helpful if you could try these. Nice, thank you! I can confirm that they both appear to work, at least = in the sense that the python-tests pass (except for the ones skipped = intentionally), and the python shell behaves reasonable. Only the set-tty-mode patch eliminates echo in the interactive python = shell; in that sense it's preferable. Both produce the very annoying warning Warning (python): Your =E2=80=98python-shell-interpreter=E2=80=99 = doesn=E2=80=99t seem to support readline, yet = =E2=80=98python-shell-completion-native-enable=E2=80=99 was t and = "python3" is not part of the = =E2=80=98python-shell-completion-native-disabled-interpreters=E2=80=99 = list. Native completions have been disabled locally. Consider = installing the python package "readline". which is not even correct since the standard Python does have a working = readline module, even if it uses libedit. > 0001-Set-tty-mode-to-raw-when-setting-up-Inferior-Python.patch sets > the Inferior Python tty to raw mode. python-ffap-module-path-1 will > no longer need to be skipped on Mac. Right, that test runs and passes. > If it is safe to set tty to raw > mode on all UNIX based systems, I prefer this method. Same here. I see no reason why it wouldn't be safe, either. > By the way, is it necessary to send > `python-shell-completion-setup-code' for every completion in > `python-shell-completion-get-completions'? To me it seems sufficient > to send it once at initialization. Indeed, it does seem a bit extravagant.