From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#60845: 30.0.50; [PATCH] Add tests for Eshell interactive completion (and fix a bug in it) Date: Tue, 5 Sep 2023 18:37:47 -0700 Message-ID: <488af1f4-f075-09e8-3b45-1d1a65266c68@gmail.com> References: <2b75d4d4-0533-2182-6da8-413391577bf5@gmail.com> <40d31b3d-d429-5a48-02bc-a3c1e4a1d903@gmail.com> <8f725450-1158-67de-7a0f-d550d867e084@gmail.com> <990abf69-d2f9-7582-c4dd-fd6bdebf04b3@gmail.com> <46c56cb6-deff-bc8f-7d29-9401b7d261b1@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------Xb71NCtwA7nzOOD8QP5HgA5E" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14715"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60845@debbugs.gnu.org, Daniel Mendler , Gregory Heytings , arstoffel@gmail.com, Stefan Monnier To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 06 03:38:15 2023 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 1qdhUk-0003bm-KO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Sep 2023 03:38:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdhUZ-0001XD-Od; Tue, 05 Sep 2023 21:38:03 -0400 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 1qdhUX-0001Wq-EB for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 21:38:01 -0400 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 1qdhUX-0006qr-6L for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 21:38:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdhUX-0005Sc-Tr for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 21:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Sep 2023 01:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60845 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60845-submit@debbugs.gnu.org id=B60845.169396427820979 (code B ref 60845); Wed, 06 Sep 2023 01:38:01 +0000 Original-Received: (at 60845) by debbugs.gnu.org; 6 Sep 2023 01:37:58 +0000 Original-Received: from localhost ([127.0.0.1]:60217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdhUT-0005SI-O4 for submit@debbugs.gnu.org; Tue, 05 Sep 2023 21:37:58 -0400 Original-Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:57399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdhUS-0005S6-2k for 60845@debbugs.gnu.org; Tue, 05 Sep 2023 21:37:56 -0400 Original-Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-573e0d471ceso883865a12.2 for <60845@debbugs.gnu.org>; Tue, 05 Sep 2023 18:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693964269; x=1694569069; darn=debbugs.gnu.org; h=in-reply-to:references:cc:to:from:content-language:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=UFIMMpU8FeoM01A9l0FMURXuiA63xTNxodESPaiiuYo=; b=dAFc61ByJ07updKHBLcoVohe9/EfcdbcedkRGj655tdwGOIBxKoS972N8p1tR5FV/V aOxo8ld69ucWtOQr5yjbQ5xrgBt4GnPSXGWDgmky73/xpVq9aXeaeco0scoawX/lROxo g3dtMwM/0QRpGZ5HEDAwHVMzH8XpQe6yVo9UyK2YDMJolCAGHnxYB0/2gaLHn/H1I543 dCrTIFAEZWA9LAJAtlZKNwm2CqOC0ErWQol5dxTZJdl+kcJWZSgbuXEnWtILgfpKS9JV LV+RuyDtWhJOqvtU+5cR0yi1R6B2qQf5zp8tEDrUTbmj7jt2LudccsA2NqMxx4VHqP4a 50Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693964269; x=1694569069; h=in-reply-to:references:cc:to:from:content-language:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=UFIMMpU8FeoM01A9l0FMURXuiA63xTNxodESPaiiuYo=; b=eYRDc9ctAYMRWjnoVW0390/ioMClwx9tkIMrFe1Jdhkfz81YCTVRWLfF4NSY6mDYZR 5fji0deDAYct7KwfMlfICURhbL/gOwuchsTAyiDnM/XyTyN/CE0Q7mO1NzPA1bER+t0c jQSbbqGqrBRBANRW6QP5TlNqcirQP3NsA4wy/qc+6flKL0Z29Qm0yUZWiYbppiWNtPxc /v1JwFzHYIlHhScKsWVXya4QAWW2t3M6uh995koMeGg1vo3h7e7SY72GKqwHyUEtn6rG d4WKWsA3vnmH4JSca9wozMTnjUwQXiL2NlUiTUhQ96HXO0e6Ef5o0ne6oJfPPNgYO5e0 otqA== X-Gm-Message-State: AOJu0YxOCFX5AyxRumA2ZsiYtVca7DpdsE+31Rj/9ZlOf3DaVmZ6xy97 gcMRRohG8reP2naQ8kUur74= X-Google-Smtp-Source: AGHT+IHVH+8wH9sn7OlUd2jl9utJsX1VVKxRg5Vap0mSEVRxNZwSYg3kmwRLsxrI7P44vRl1yvdjwg== X-Received: by 2002:a05:6a21:35c9:b0:14c:c393:fce with SMTP id ba9-20020a056a2135c900b0014cc3930fcemr11722195pzc.23.1693964268977; Tue, 05 Sep 2023 18:37:48 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id t20-20020a63b254000000b0054fa8539681sm2702564pgo.34.2023.09.05.18.37.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Sep 2023 18:37:48 -0700 (PDT) Content-Language: en-US In-Reply-To: <46c56cb6-deff-bc8f-7d29-9401b7d261b1@gmail.com> 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:269466 Archived-At: This is a multi-part message in MIME format. --------------Xb71NCtwA7nzOOD8QP5HgA5E Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/5/2023 5:47 PM, Jim Porter wrote: > On 9/5/2023 4:36 PM, Stefan Kangas wrote: >> Jim Porter writes: >> >>> On 1/30/2023 6:54 AM, Stefan Monnier via Bug reports for GNU Emacs, >>> the Swiss >>> army knife of text editors wrote: >>>> It sounds good to me, but I'm definitely not well versed in this aspect >>>> of the interaction between Eshell and Pcomplete (more specifically, >>>> this is a part of their interaction which I find quite tricky), so it's >>>> good that you add corresponding regression tests. >>> >>> Thanks for taking a look. I've merged my patches as e7d0aa248e. We >>> can leave >>> this open though to discuss what to do about the Pcomplete side of >>> things. I >>> think we can remove the workaround for Emacs 29, but maybe we want some >>> additional changes. >> >> That was 9 months ago.  Is it still relevant to keep this bug open? > > Yes, I believe so. I was planning to wait until Emacs 29.1 was released > before pinging people on this, but then forgot all about it. We should > probably use this time to fix the FIXME in 'pcomplete-arg', since (I > think) the current behavior in Eshell no longer requires the FIXME bit: > >             ;; FIXME: 'last' is handled specially in Emacs 29, because >             ;; 'pcomplete-parse-arguments' accepts a list of strings >             ;; (which are completion candidates) as return value for >             ;; (pcomplete-arg 'last).  See below: "it means it's a >             ;; list of completions computed during parsing, >             ;; e.g. Eshell uses that to turn globs into lists of >             ;; completions".  This special case will be dealt with >             ;; differently in Emacs 30: the pcomplete-arg-value >             ;; property will be used by 'pcomplete-parse-arguments'. Attached is a patch to revert the Emacs 29 workarounds. I *believe* I've fixed this on the Eshell side by always providing Pcomplete with the arguments in their string form. Could everyone try the patch out to make sure things still work? In particular, see the cases in the following bugs: bug#60464, bug#60021, and bug#59956. --------------Xb71NCtwA7nzOOD8QP5HgA5E Content-Type: text/plain; charset=UTF-8; name="0001-Revert-commits-dafa6d6badd6-and-72c45fa9109a.patch" Content-Disposition: attachment; filename="0001-Revert-commits-dafa6d6badd6-and-72c45fa9109a.patch" Content-Transfer-Encoding: base64 RnJvbSBiMDdiNWEzN2JjMGY0OTRhNGE5M2M5YTU0YWQ3ZTMwMmFjNzRjOTNkIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFR1ZSwgNSBTZXAgMjAyMyAxODoyNzoyMSAtMDcwMApTdWJqZWN0OiBbUEFU Q0hdIFJldmVydCBjb21taXRzIGRhZmE2ZDZiYWRkNiBhbmQgNzJjNDVmYTkxMDlhCgpUaGVz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AogKGRlZnVuIHBjb21wbGV0ZS1iZWdpbiAoJm9wdGlvbmFsIGluZGV4IG9mZnNldCkK ICAgIlJldHVybiB0aGUgYmVnaW5uaW5nIHBvc2l0aW9uIG9mIHRoZSBJTkRFWHRoIGFyZ3Vt ZW50LgotLSAKMi4yNS4xCgo= --------------Xb71NCtwA7nzOOD8QP5HgA5E--