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: Wed, 07 Feb 2024 00:12:39 +0900 Message-ID: References: <83zfx39mcy.fsf@gnu.org> <87a5og8m7t.fsf@gmail.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") 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="22562"; 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 Tue Feb 06 16:13:00 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 1rXN87-0005dK-Ae for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Feb 2024 16:12:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXN7y-0004qC-M7; Tue, 06 Feb 2024 10:12:50 -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 1rXN7x-0004q0-BP for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2024 10:12:49 -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 1rXN7x-0004Q0-3E for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2024 10:12:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rXN89-0002XW-L8 for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2024 10:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Feb 2024 15:13: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.17072323819756 (code B ref 68559); Tue, 06 Feb 2024 15:13:01 +0000 Original-Received: (at 68559) by debbugs.gnu.org; 6 Feb 2024 15:13:01 +0000 Original-Received: from localhost ([127.0.0.1]:54918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXN88-0002XI-Nh for submit@debbugs.gnu.org; Tue, 06 Feb 2024 10:13:01 -0500 Original-Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:58743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXN87-0002X5-Ge for 68559@debbugs.gnu.org; Tue, 06 Feb 2024 10:13:00 -0500 Original-Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5d4d15ec7c5so5198634a12.1 for <68559@debbugs.gnu.org>; Tue, 06 Feb 2024 07:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707232360; x=1707837160; darn=debbugs.gnu.org; h=content-transfer-encoding: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=wlKcG7W7/tSl4++DBJ6CwxpyUBAoBYYBaHpmeDH85Co=; b=SLPL8kUcTkqVYPxd8hpKE07ClFlrbujjJd0rsuFC0BHaJcC8NBcwB/cla7tjPWeOJ7 4TGPLOidxawhgU5yuAvwqKzEhXwBMPxIYkw+WYFAoexfHDG+Wej/GBu3L4eV7mFy8WfE 94IYG5jo+Mzvx4Z6HcpeVUnRDtnaO8CIf0FrO/KROZpMt6/YpTIuKeaFj9wHp5EyYXLK FihxRcx9sj3BTDMd142YIcUHk9gnOdtpFEdxhhaBSSbmWTCx19tFQBVZtHjhxrlfnIwd PfKmiW7ICSkKzS4r1iMvb6f12Fm/qR3VqtA5QZBDTUmH1K7Yxk0rnAbKTYM/vcIZoibP rgaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707232360; x=1707837160; h=content-transfer-encoding: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=wlKcG7W7/tSl4++DBJ6CwxpyUBAoBYYBaHpmeDH85Co=; b=MJZ2e+E4iEaqEPlpzkBVCv9pIvEMXJxHh96JuZb3HhDlfw+G64vp378joBefgwwmqo skMOKU8ocGPRMCEjTMEXSPP9W+XrvvlEvbTyweb9JCWs2stFgBnGNw7U4EViUfN2OYJb 1+SqRe5B1cw8aCMtZ7xyLHrJ3gRYHv3mFT8r0zUy2P703KVd9RAAEHwQXBkyQX7NDd9B czMhjJd2YB84HW8kIRFMFG0w68bube63GY/8MLMjRns6R0hLDYmGkP+l8GAKVqJx8cmh Gfk8KxJnQp0Z8FhB4iI6n/inMgmr+YquExkpSxWwcqbxjywbZ23MovQXB0Xkq4usSg0v kwzQ== X-Gm-Message-State: AOJu0YyXwlbjMUWg1OuBlEByxIdi8+UIye4fPrSi5lQX5d3qKTSYCsjv 2bCtlSE0S2HbqE90ez0sHC/rSwMV0L97Vqt1J6qX4g+fn5F/0OgEQ4Hyw+v0 X-Google-Smtp-Source: AGHT+IFrrN2U8NGGtIRV1410fhD7soP6ljha6TVOAhUWw9kGNEclESG8DRN8wRt5gGe/XEeN+Ci83w== X-Received: by 2002:a17:90a:fe81:b0:293:eaec:fd67 with SMTP id co1-20020a17090afe8100b00293eaecfd67mr2447258pjb.14.1707232360311; Tue, 06 Feb 2024 07:12:40 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX6MAn4MBTBYdl/iS0W+L7v1ce7A6waYvmoFijcwoMT9v/NlgkHdCn+gtsbzjC3fTcmT9li+YAl1/qGyQOFbHSERUKVvgQ= Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id mz17-20020a17090b379100b002966a13f2e9sm1753328pjb.37.2024.02.06.07.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 07:12:39 -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:279497 Archived-At: Liu Hui wrote: > On Mon, Feb 5, 2024 at 11:03=E2=80=AFPM Liu Hui wr= ote: >=20 > > > Thank you for the detailed explanation and the workaround. I > > > confirmed that the problem is solved by the above workaround. Just to > > > confirm, are you of the opinion that this workaround should not be the > > > default? > > > > I'm not sure if we should add more Python code in the form of strings > > to python.el, which increases maintenance burden IMO. Maybe they could > > be distributed separately at ELPA/Git forges. > > > > Actually, I'm considering simplifying this patch to mainly fix the bug > > that python shell completion doesn't respect the delimiter of readline > > completer. The new patch has been attached. It should support > > the completer defined in the PYTHONSTARTUP file, e.g., jedi or a > > custom completer like the above one. WDYT? >=20 > I have updated documentation about readline completer and fixed an > error in commit log in the attach patch. Thanks, I understood your concern. I tried the new patch and confirmed that your MyJediRL can be used as a custom completer by storing it in a file specified in the PYTHONSTARTUP environment variable. This may be the better way to go. Sorry, I noticed one more thing. As written in the comments below, it would be better to use `line-beginning-position' and `line-end-position' instead of `pos-bol' and `pos-eol'. ;; This is a GNU ELPA :core package. Avoid functionality that is not ;; compatible with the version of Emacs recorded above.