GNU bug report logs - #61283
29.0.60; pcomplete-completions-at-point loses text properties, breaking pcomplete-from-help annotations

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Daniel Mendler <mail@HIDDEN>; merged with #65844; dated Sun, 5 Feb 2023 00:24:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Forcibly Merged 61283 65844. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 23 May 2023 04:17:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 23 00:17:14 2023
Received: from localhost ([127.0.0.1]:37752 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q1JST-0005Hl-8B
	for submit <at> debbugs.gnu.org; Tue, 23 May 2023 00:17:14 -0400
Received: from mail-pf1-f177.google.com ([209.85.210.177]:60655)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1q1JSM-0005H9-Vf
 for 61283 <at> debbugs.gnu.org; Tue, 23 May 2023 00:17:11 -0400
Received: by mail-pf1-f177.google.com with SMTP id
 d2e1a72fcca58-64d2c865e4eso3559964b3a.0
 for <61283 <at> debbugs.gnu.org>; Mon, 22 May 2023 21:17:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684815421; x=1687407421;
 h=in-reply-to:from:references:cc:to:content-language:subject
 :mime-version:date:message-id:from:to:cc:subject:date:message-id
 :reply-to; bh=ZjCoWM0v2Oqbh9rUTfzHL2x7cPI3Q6v5lrrDBniI2lE=;
 b=Bg59J/LUKOUhiY6kknOZqL1tPwVujym20Oap/p22j6Ck8mHFhNcQP/Ji0yYM2RAtr4
 m2gOhDF6bxwVnXk/WZcJr9qL9eGOGxhRqDfPDBiFjwMyIvmELEvqbWXiU/idDuOlvCJb
 0nHLJvp/WUdqWpVSQrnw9Iaftu6ZXL4Cim37NlF8z5STKFdsAIstJ8/4tkr+P6CpDPdG
 T095YgJmjpNcSNFSKPmX8OVOEbD5oya1OcZ76ZElR0uciaMAbI6Vc7R2EswksCIrJqdB
 +V7yYaGRe4dfux7Is6U/1dxc9SdPj5D0ruv/JKavRNMUjAt5Fg7ieBaaTTyNAbkn2RNB
 czxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684815421; x=1687407421;
 h=in-reply-to:from:references:cc:to:content-language:subject
 :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject
 :date:message-id:reply-to;
 bh=ZjCoWM0v2Oqbh9rUTfzHL2x7cPI3Q6v5lrrDBniI2lE=;
 b=HdqzE32IUNw/AswLL0EzsIP7kmwFv8t1K4wF+gcuMGHfGm8PnWCSbqeVve+neE3XqX
 zWRHI/uU1HFZOhpOmVALjQzF16ndETTBaFmrZPUT145IJtHWHS8iQAGquUb3G7CkEHAz
 akv+CogLuKzd9gpDTxZ9RLgvtms7X77Twpk1PiZathzvYvmW3O2Lv4Rgn3J14D0Zk/Ke
 TddnmAh8iIeSO5TfkVg9rHwRJ6fvp8Fe39j7vujGr7saZkQGjlon79fz79y1ZrMb2US3
 ysvlTDq6/K7Z5mSXg1Mm+0Colk60k/dggIEX4KX5V4h9MvvChS5XmqccMu3aOAA7ThD7
 Qtig==
X-Gm-Message-State: AC+VfDwmJqunqid2Hy4L9rEwKr5zkuhlfLt4j4m6DaFWqZPf2x+1fSLy
 OC2r+Zd2CvOOAiuXDu0KYMU=
X-Google-Smtp-Source: ACHHUZ5o1+NNA5IlYiOooiFZwtzwvG5bo5aSnwM0R1bhwBs+ohXRVs1JYhsW+LPdxqdJqUTVUwYd0w==
X-Received: by 2002:a05:6a00:24d4:b0:64d:2c61:4b1 with SMTP id
 d20-20020a056a0024d400b0064d2c6104b1mr16577654pfv.11.1684815420793; 
 Mon, 22 May 2023 21:17:00 -0700 (PDT)
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
 u10-20020a63140a000000b005344b30d449sm5037656pgl.86.2023.05.22.21.16.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 22 May 2023 21:17:00 -0700 (PDT)
Content-Type: multipart/mixed; boundary="------------NgJ2b5Tutov0chumaikTXNP8"
Message-ID: <c3db3507-4103-63b9-538c-2ff477234271@HIDDEN>
Date: Mon, 22 May 2023 21:16:59 -0700
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
Content-Language: en-US
To: Stefan Monnier <monnier@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
 <e447e45e-f3b1-586e-40b8-640ec1da007e@HIDDEN>
 <jwvr0rdvkdt.fsf-monnier+emacs@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <jwvr0rdvkdt.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 61283
Cc: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 liuhui1610@HIDDEN, Augusto Stoffel <arstoffel@HIDDEN>,
 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------NgJ2b5Tutov0chumaikTXNP8
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 5/18/2023 6:30 AM, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
>> ... since getting a 100% reliable solution here might take quite a bit more
>> work than I thought, how about a not-quite-100% hack? Instead of
>> propertizing the first character of each candidate, propertize the *last*
>> character (or the entire string?). That won't get thrown out quite
>> so easily.
> 
> I'll see your "last char" and raise you a "the whole string" (and then
> use the property on the first char where it's found, using
> `next-single-property-change`)?

After thinking this over some more, how about a completely different 
strategy like the following? This uses a programmed completion 
function[1] to supply an annotation-function as appropriate.

This also fixes a tangentially-related issue where long options that 
take an argument added an extraneous space after the trailing "=". (This 
bit is actually the original patch I was working on before discovering 
the issue described in this bug.)

Pcomplete might have some issues with handling programmed completion 
functions like this, but I *think* it makes sense to go this route if 
possible: making Pcomplete work more like the rest of Emacs' completion 
code would be very nice.

[1] "Programmed completion" vs "programmable completion (Pcomplete)": 
*that's* definitely not confusing at all. ;)
--------------NgJ2b5Tutov0chumaikTXNP8
Content-Type: text/plain; charset=UTF-8;
 name="0001-WIP-Use-a-programmed-completion-function-to-handle-l.patch"
Content-Disposition: attachment;
 filename*0="0001-WIP-Use-a-programmed-completion-function-to-handle-l.pa";
 filename*1="tch"
Content-Transfer-Encoding: base64

RnJvbSA0NGEwODMzZWUxODkxZWE4NDcyN2NhOTk0ZWNmYTFhMzRhNDlkNWUzIE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j
b20+CkRhdGU6IEZyaSwgMTAgRmViIDIwMjMgMTM6NTI6MzMgLTA4MDAKU3ViamVjdDogW1BB
VENIXSBXSVA6IFVzZSBhIHByb2dyYW1tZWQgY29tcGxldGlvbiBmdW5jdGlvbiB0byBoYW5k
bGUgbG9uZwogb3B0aW9ucyBpbiBQY29tcGxldGUKClRoaXMgZG9lcyB0d28gdGhpbmdzOgoK
MS4gV2hlbiBjb21wbGV0aW5nIGFuIG9wdGlvbiB0aGF0IHRha2VzIGFuIGFyZ3VtZW50IChp
LmUuIGFuIG9wdGlvbgogICBzdHJpbmcgZW5kaW5nIGluICI9IiksIGRvbid0IGFkZCBhIHRy
YWlsaW5nIHNwYWNlLiAgVGhlIHNwYWNlIGlzCiAgIHVuaGVscGZ1bCwgc2luY2UgdGhlIHVz
ZXIgbGlrZWx5IHdhbnRzIHRvIGFkZCBhIHZhbHVlIGZvciB0aGF0CiAgIG9wdGlvbiBpbW1l
ZGlhdGVseSBhZnRlciB0aGUgIj0iLgoKMi4gUmV0dXJuIGFuIGFwcHJvcHJpYXRlICdhbm5v
dGF0aW9uLWZ1bmN0aW9uJyBmb3IgdGhlIG9wdGlvbiB0bwogICBoYW5kbGUgdGhlICdwY29t
cGxldGUtYW5ub3RhdGlvbicgdGV4dCBwcm9wZXJ0eS4gIE1heWJlIHdlIHNob3VsZAogICBz
dG9yZSB0aGUgYW5ub3RhdGlvbiBzb21ld2hlcmUgb3RoZXIgdGhhbiBhIHRleHQgcHJvcGVy
dHksIGJ1dCB0aGlzCiAgIHdvcmtzIGFzIGEgcHJvb2Ygb2YgY29uY2VwdC4uLgotLS0KIGxp
c3AvcGNtcGwtZ251LmVsIHwgIDMgKystCiBsaXNwL3Bjb21wbGV0ZS5lbCB8IDQxICsrKysr
KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKystCiAyIGZpbGVzIGNoYW5nZWQs
IDQyIGluc2VydGlvbnMoKyksIDIgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9w
Y21wbC1nbnUuZWwgYi9saXNwL3BjbXBsLWdudS5lbAppbmRleCAxNTUzYzNlZmVkNy4uNDg4
YTA1MDFhNDggMTAwNjQ0Ci0tLSBhL2xpc3AvcGNtcGwtZ251LmVsCisrKyBiL2xpc3AvcGNt
cGwtZ251LmVsCkBAIC0yNzQsNyArMjc0LDggQEAgcGNvbXBsZXRlL3RhcgogICAgICAgKGlm
IChwY29tcGxldGUtbWF0Y2ggIl4tLSIgMCkKICAgICAgICAgICAoY29uZAogICAgICAgICAg
ICAoKHBjb21wbGV0ZS1tYXRjaCAiXi0tXFwoW149IFx0XG5cZl0qXFwpXFwnIiAwKQotICAg
ICAgICAgICAgKHBjb21wbGV0ZS1oZXJlKiBwY21wbC1nbnUtLXRhci1sb25nLW9wdGlvbnMp
KQorICAgICAgICAgICAgKHBjb21wbGV0ZS1oZXJlKiAocGNvbXBsZXRlLWxvbmctb3B0aW9u
LWNvbXBsZXRpb24tdGFibGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBjbXBs
LWdudS0tdGFyLWxvbmctb3B0aW9ucykpKQogICAgICAgICAgICAoKHBjb21wbGV0ZS1tYXRj
aCAiXFxgLS1kaXJlY3Rvcnk9XFwoLipcXCkiIDApCiAgICAgICAgICAgICAocGNvbXBsZXRl
LWhlcmUqIChwY29tcGxldGUtZGlycykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
KHBjb21wbGV0ZS1tYXRjaC1zdHJpbmcgMSAwKSkpCmRpZmYgLS1naXQgYS9saXNwL3Bjb21w
bGV0ZS5lbCBiL2xpc3AvcGNvbXBsZXRlLmVsCmluZGV4IDM2ZjY4ZjFhZjU3Li40ODUwYTNh
YjljMSAxMDA2NDQKLS0tIGEvbGlzcC9wY29tcGxldGUuZWwKKysrIGIvbGlzcC9wY29tcGxl
dGUuZWwKQEAgLTEzNzEsNiArMTM3MSw0NCBAQCBwY29tcGxldGUtcmVhZC1ob3N0LW5hbWVz
CiAgICAgICAocGNvbXBsZXRlLXJlYWQtaG9zdHMgcGNvbXBsZXRlLWhvc3RzLWZpbGUgJ3Bj
b21wbGV0ZS0taG9zdC1uYW1lLWNhY2hlCiAgICAgICAgICAgICAgICAgICAgJ3Bjb21wbGV0
ZS0taG9zdC1uYW1lLWNhY2hlLXRpbWVzdGFtcCkpKQogCisoZGVmdW4gcGNvbXBsZXRlLWxv
bmctb3B0aW9uLWNvbXBsZXRpb24tdGFibGUgKG9wdGlvbnMpCisgICJNYWtlIGEgY29tcGxl
dGlvbiB0YWJsZSBmb3IgYSBsaXN0IG9mIE9QVElPTlMuCitPUFRJT05TIHNob3VsZCBiZSBh
IGxpc3Qgb2Ygb3B0aW9uIHN0cmluZ3M7IGlmIGEgc3RyaW5nIGVuZHMgaW4KK1wiPVwiLCBp
dCdzIGFuIG9wdGlvbiB0aGF0IGFjY2VwdHMgYSB2YWx1ZS4gIFlvdSBjYW4gYWxzbyBzZXQg
dGhlCitjb21wbGV0aW9uIGFubm90YXRpb24gYnkgcHV0dGluZyB0aGUgYHBjb21wbGV0ZS1h
bm5vdGF0aW9uJworcHJvcGVydHkgb24gdGhlIGZpcnN0IGNoYXJhY3RlciBvZiBhbiBvcHRp
b24uIgorICAobGFtYmRhIChzdHJpbmcgcHJlZCBhY3Rpb24pCisgICAgKHBjYXNlIGFjdGlv
bgorICAgICAgKCduaWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOyB0cnktY29t
cGxldGlvbgorICAgICAgIChsZXQgKChyZXN1bHQgKHRyeS1jb21wbGV0aW9uIHN0cmluZyBv
cHRpb25zIHByZWQpKSkKKyAgICAgICAgIDs7IElmIHRoZSBjb21wbGV0aW9uIGVuZHMgaW4g
Ij0iLCB0aGVuIGl0J3Mgbm90IHJlYWxseQorICAgICAgICAgOzsgY29tcGxldGUgeWV0OiB3
ZSBleHBlY3QgYSB2YWx1ZSBhZnRlciB0aGUgIj0iLiAgUmV0dXJuIHRoZQorICAgICAgICAg
Ozsgb3JpZ2luYWwgU1RSSU5HIGluIHRoaXMgY2FzZSBpbnN0ZWFkIG9mIHQgdG8gaW5kaWNh
dGUKKyAgICAgICAgIDs7IHRoYXQuCisgICAgICAgICAoaWYgKGFuZCAoZXEgcmVzdWx0IHQp
IChzdHJpbmctc3VmZml4LXAgIj0iIHN0cmluZykpCisgICAgICAgICAgICAgc3RyaW5nCisg
ICAgICAgICAgIHJlc3VsdCkpKQorICAgICAgKCd0ICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgOyBhbGwtY29tcGxldGlvbnMKKyAgICAgICAoYWxsLWNvbXBsZXRpb25zIHN0
cmluZyBvcHRpb25zIHByZWQpKQorICAgICAgKCdsYW1iZGEgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgOyB0ZXN0LWNvbXBsZXRpb24KKyAgICAgICAgKGxldCAoKHJlc3VsdCAodGVz
dC1jb21wbGV0aW9uIHN0cmluZyBvcHRpb25zIHByZWQpKSkKKyAgICAgICAgICAoaWYgKGFu
ZCAoZXEgcmVzdWx0IHQpIChzdHJpbmctc3VmZml4LXAgIj0iIHN0cmluZykpCisgICAgICAg
ICAgICAgIHN0cmluZworICAgICAgICAgICAgcmVzdWx0KSkpCisgICAgICAoJ21ldGFkYXRh
CisgICAgICAgOzsgRklYTUU6IFRoZXJlJ3MgcHJvYmFibHkgYSBjbGVhbmVyIHdheSB0byBk
byB0aGlzIGlmIHdlCisgICAgICAgOzsgY2hhbmdlIGhvdyBPUFRJT05TIGlzIHN0cnVjdHVy
ZWQuICBXZSBzaG91bGQgYWxzbyBzdXBwb3J0CisgICAgICAgOzsgaGVscCB0ZXh0LgorICAg
ICAgIGAobWV0YWRhdGEgKGFubm90YXRpb24tZnVuY3Rpb24KKyAgICAgICAgICAgICAgICAg
ICAuICwobGFtYmRhIChzKQorICAgICAgICAgICAgICAgICAgICAgICAgKGdldC10ZXh0LXBy
b3BlcnR5CisgICAgICAgICAgICAgICAgICAgICAgICAgMCAncGNvbXBsZXRlLWFubm90YXRp
b24KKyAgICAgICAgICAgICAgICAgICAgICAgICAoc2VxLWZpbmQgKGxhbWJkYSAoY2FuZCkg
KHN0cmluZz0gcyBjYW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
b3B0aW9ucykpKSkpKQorICAgICAgKGAoYm91bmRhcmllcyAuICxfc3VmZml4KQorICAgICAg
IDs7IEZJWE1FOiBJbXBsZW1lbnQgYm91bmRhcmllcy4KKyAgICAgICAnKGJvdW5kYXJpZXMg
MCAuIDApKSkpKQorCiA7OzsgUGFyc2luZyBoZWxwIG1lc3NhZ2VzCiAKIChkZWZ2YXIgcGNv
bXBsZXRlLWZyb20taGVscCAobWFrZS1oYXNoLXRhYmxlIDp0ZXN0ICMnZXF1YWwpCkBAIC0x
NDk1LDcgKzE1MzMsOCBAQCBwY29tcGxldGUtaGVyZS11c2luZy1oZWxwCiAgICAgICAgICAg
IChwY29tcGxldGUtaGVyZSAocGNvbXBsZXRlLWVudHJpZXMpCiAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAocGNvbXBsZXRlLW1hdGNoLXN0cmluZyAxIDApKSkKICAgICAgICAgICAo
KHN0cmluZy1wcmVmaXgtcCAiLSIgKHBjb21wbGV0ZS1hcmcgMCkpCi0gICAgICAgICAgIChw
Y29tcGxldGUtaGVyZSAoYXBwbHkgIydwY29tcGxldGUtZnJvbS1oZWxwIGNvbW1hbmQgYXJn
cykpKQorICAgICAgICAgICAocGNvbXBsZXRlLWhlcmUgKHBjb21wbGV0ZS1sb25nLW9wdGlv
bi1jb21wbGV0aW9uLXRhYmxlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFwcGx5
ICMncGNvbXBsZXRlLWZyb20taGVscCBjb21tYW5kIGFyZ3MpKSkpCiAgICAgICAgICAgKHQg
KHBjb21wbGV0ZS1oZXJlKiAocGNvbXBsZXRlLWVudHJpZXMpKSkpKSkKIAogKHByb3ZpZGUg
J3Bjb21wbGV0ZSkKLS0gCjIuMjUuMQoK

--------------NgJ2b5Tutov0chumaikTXNP8--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 18 May 2023 13:38:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 18 09:38:06 2023
Received: from localhost ([127.0.0.1]:52726 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzdpW-0001sb-9p
	for submit <at> debbugs.gnu.org; Thu, 18 May 2023 09:38:06 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38017)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1pzdpU-0001s3-Vl
 for 61283 <at> debbugs.gnu.org; Thu, 18 May 2023 09:38:05 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A16764413FF;
 Thu, 18 May 2023 09:37:59 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 54E2E44082B;
 Thu, 18 May 2023 09:37:58 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1684417078;
 bh=Ca7EBDfJX+DJ7BrKK3fI93M9DCQ/zG6alD9rvEsAuhM=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=dBYSFJTeVRjwdUZPvCofX08UDtCgVfEf5bkA5ElXp7rjtscnXaxexxO71r4zU7UHi
 DFG7xeFylCPbW4jLClb1qkeVnP8K/T2nWgfomO7eP/cm9sD3ZxmnqsE8tskZD4K3oV
 fjrACsrLi4ynx2Xl1eg/K+HnBhhb8vLbVG47Vbp4F4q0akoNTkWgZ2gNl1uJoyO2Bt
 XUS7wkwljm5KxYx8do26RpzTMGyWbzehjjEylDSbKYeH1QieroUxhpBvSgg6SeEn2n
 JCB48hPocuYwhG2CWIAs1q2R2sc5k4vbZj8RmVUTR+CHMJQ6ozofVGh3zYsoK3LCQz
 R5n9z/Z9bAoPA==
Received: from pastel (unknown [45.72.217.176])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0893F120317;
 Thu, 18 May 2023 09:37:58 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
In-Reply-To: <83sfbuw639.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 18 May
 2023 08:39:54 +0300")
Message-ID: <jwvlehlvka6.fsf-monnier+emacs@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
 <3e8bced6-28f8-a0d0-3a74-2907bc241d53@HIDDEN>
 <83sfbuw639.fsf@HIDDEN>
Date: Thu, 18 May 2023 09:37:57 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.047 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: Daniel Mendler <mail@HIDDEN>, liuhui1610@HIDDEN,
 61283 <at> debbugs.gnu.org, arstoffel@HIDDEN, jporterbugs@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> But this means that the following simple patch to `completion--twq-all'
>> also fixes the issue. It ensures that the original string is preserved
>> in the common case where string quoting was ineffective. This approach
>> may be better than refactoring pcomplete.el. The patch may even be safe
>> enough for emacs-29.

Sounds like a good enough "quick hack" for Emacs-29, indeed.

I don't think it's a good long term solution, tho, because it's a hack
in the generic `completion-table-with-quoting` code added specifically
for `pcomplete-from-help`.  I'd *much* prefer a hack which touches
only `pcomplete.el`.
[ Maybe I'd be OK with a solution in the generic code but only if it's
  an actual robust solution, rather than a hack.  ]

> Why do you think it will be safe for emacs-29?

Because it replace a string with one which is `equal` to the other.
There is of course a risk that the string object is later mutated under
the assumption that it's a fresh new string, so it's not 100% safe in
theory, but I'd judge it to be very safe.

> And why do we have to fix this in Emacs 29.1?

We don't.  From where I stand the main interest of the
`pcomplete-from-help` feature is the completion itself rather than the
additional help it can provide, so I'm perfectly fine with not fixing it
for Emacs-29.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 18 May 2023 13:30:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 18 09:30:39 2023
Received: from localhost ([127.0.0.1]:52705 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzdiI-0001hH-Kg
	for submit <at> debbugs.gnu.org; Thu, 18 May 2023 09:30:38 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35897)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1pzdiF-0001h2-K1
 for 61283 <at> debbugs.gnu.org; Thu, 18 May 2023 09:30:37 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 42BB74413F7;
 Thu, 18 May 2023 09:30:30 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 08CFC4404E2;
 Thu, 18 May 2023 09:30:29 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1684416629;
 bh=aMHHopDH7/JyrkNZ7qJBaZ2Lqm1oK0FgQNIb5/Sa0bU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=m84eJTyjoMlX6sqLKlvnp1RXN8HwJvScFg1IusVZ6AiAuJpvEHDYQ/Li7Vp2i4a1q
 xfVirWj5A7AjBjYrpSEUDAw1L72yW6OgSMUyJkUD28GHrVC3hQL7TquJG9zHkqTTd5
 u/kEyR+3udzUIk3o3nAryj1M4xfNqzwvHZEesao0V9I4tQyiIVwJJZPAc+bXv70o9y
 kvoAe9mTTZGR6e8gUonfmWmRONWQtRGclIt8+Z36GQoTtbL98csv4ALZnwhbdDmuSV
 DK1zPWodWTP372LUbZ2NFMV8Gmuu0fsDWWwNAb4bxkWglATtpj01lQhzOYfsjM3V7x
 9XrVCArjZh+3A==
Received: from pastel (unknown [45.72.217.176])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C16B912026E;
 Thu, 18 May 2023 09:30:28 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
In-Reply-To: <e447e45e-f3b1-586e-40b8-640ec1da007e@HIDDEN> (Jim Porter's
 message of "Thu, 18 May 2023 00:11:09 -0700")
Message-ID: <jwvr0rdvkdt.fsf-monnier+emacs@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
 <e447e45e-f3b1-586e-40b8-640ec1da007e@HIDDEN>
Date: Thu, 18 May 2023 09:30:28 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.047 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 61283 <at> debbugs.gnu.org, Augusto Stoffel <arstoffel@HIDDEN>,
 liuhui1610@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> ... since getting a 100% reliable solution here might take quite a bit more
> work than I thought, how about a not-quite-100% hack? Instead of
> propertizing the first character of each candidate, propertize the *last*
> character (or the entire string?). That won't get thrown out quite
> so easily.

I'll see your "last char" and raise you a "the whole string" (and then
use the property on the first char where it's found, using
`next-single-property-change`)?


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 18 May 2023 08:37:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 18 04:37:49 2023
Received: from localhost ([127.0.0.1]:51958 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzZ8v-0002V6-1I
	for submit <at> debbugs.gnu.org; Thu, 18 May 2023 04:37:49 -0400
Received: from server.qxqx.de ([178.63.65.180]:53137 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1pzZ8t-0002Ut-Iq
 for 61283 <at> debbugs.gnu.org; Thu, 18 May 2023 04:37:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
 References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=2d9f+7tnP2rwiadZe171hQduz0GxaOe24IRSRlQ1bs0=; b=M/fgoLfms10zTd6VDt8U5ztlzp
 5uzuQdvACoK8AhO0KRp2EJTlY3FtPqO6nJ14YDzJzM46ExNmshp6sDmpLmUq5kQORdO916QEYPEO+
 1URDBmk57Gk4gSBkzHBPEYQn68shtrY4x+c0kO1zunJvuipEA4jAQFd9pkmu7DlTVTLM=;
Message-ID: <110de257-14fa-fe79-3331-1fb9260f19c0@HIDDEN>
Date: Thu, 18 May 2023 10:37:40 +0200
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
Content-Language: en-US
To: Jim Porter <jporterbugs@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
 <e447e45e-f3b1-586e-40b8-640ec1da007e@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <e447e45e-f3b1-586e-40b8-640ec1da007e@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Augusto Stoffel <arstoffel@HIDDEN>, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 5/18/23 09:11, Jim Porter wrote:
> Hmm, yeah. That would be pretty tricky to get working 100% reliably. 
> Like Daniel mentions, I think this doesn't come up (often?) for the 
> specific case in this bug, but a fully-robust solution would be ideal. 
> Maybe the 'metadata' operation[1] would be usable for this with some 
> extra work. I'll have to think about this...
> 
> ... since getting a 100% reliable solution here might take quite a bit 
> more work than I thought, how about a not-quite-100% hack? Instead of 
> propertizing the first character of each candidate, propertize the 
> *last* character (or the entire string?). That won't get thrown out 
> quite so easily.

I've tried propertizing other parts of the string and finding the
position with `text-property-not-all' in the annotation function.
Unfortunately this did not work since the quoting in
`completion--twq-all' recreates the entire string. However it can happen
that the string content after quoting just stays the same. This is what
I tried to use in my patch, by just returning the original string in
that case.

Daniel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 18 May 2023 08:29:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 18 04:29:54 2023
Received: from localhost ([127.0.0.1]:51936 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzZ1F-0002HA-Og
	for submit <at> debbugs.gnu.org; Thu, 18 May 2023 04:29:54 -0400
Received: from server.qxqx.de ([178.63.65.180]:42785 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1pzZ1C-0002Gu-NK
 for 61283 <at> debbugs.gnu.org; Thu, 18 May 2023 04:29:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
 References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=DkDq2ESnN/5LdyNNrcl0pw0btErby1VYkq7Iy3kWrLY=; b=oHVkWN24XRWu13zKb29Ei8C/ar
 EoElZ64pCXxZkQT9FEw9goPsPLEMSWeFE86MzyBQGy+tM/AZZsVJlhPClG3FYd+PdjRKub92r+TEt
 es09uU+NFChmDHPtQ8dnSoRxUl0A3VTkEEePvo/F1LPoGbDJyB+u4zczL50ECMViuQbk=;
Message-ID: <3fe54b57-3832-1b08-3dff-bceeecd160ea@HIDDEN>
Date: Thu, 18 May 2023 10:29:41 +0200
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>, monnier@HIDDEN
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
 <3e8bced6-28f8-a0d0-3a74-2907bc241d53@HIDDEN>
 <83sfbuw639.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <83sfbuw639.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: jporterbugs@HIDDEN, liuhui1610@HIDDEN, arstoffel@HIDDEN,
 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)



On 5/18/23 07:39, Eli Zaretskii wrote:
>> Date: Thu, 18 May 2023 04:01:46 +0200
>> Cc: Augusto Stoffel <arstoffel@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
>>  61283 <at> debbugs.gnu.org, liuhui1610@HIDDEN
>> From: Daniel Mendler <mail@HIDDEN>
>>
>> Yes, this occurred to me too. I assume relying on the original string
>> should work since quoting should not change the string. Options like
>> "--color=" are not affected by quoting.
>>
>> But this means that the following simple patch to `completion--twq-all'
>> also fixes the issue. It ensures that the original string is preserved
>> in the common case where string quoting was ineffective. This approach
>> may be better than refactoring pcomplete.el. The patch may even be safe
>> enough for emacs-29.
> 
> Why do you think it will be safe for emacs-29?
> 
> And why do we have to fix this in Emacs 29.1?  This only affects
> Eshell, AFAIU, is that true?

The patch I've sent changes `completion--twq-all' in such a way that the
original candidate string including its properties is preserved if the
string content was not changed at all by the quoting mechanism.

This is a localized change which adjusts only `completion--twq-all', the
problematic function, which causes this issue and avoids refactorings at
other places. In my test this modification fixes the annotation issue in
Eshell. Annotations are also shown in Shell.

Maybe Stefan can take a look at tell if he considers the approach safe?
Usually candidates passed through `completion--twq-all' are not
propertized, since they are file names. In cases where candidates are
still propertized as with Pcomplete here, property preservation is
likely preserved.

Daniel

------

From: Daniel Mendler <mail@HIDDEN>
Date: Wed, 17 May 2023 10:23:25 +0200
Subject: [PATCH] Preserve pcomplete annotation and help (bug#61283)

lisp/minibuffer.el (completion--twq-all): Preserve string properties
in if quoted string equals original string.
---
 lisp/minibuffer.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 747c9443af..804c5d38ca 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -690,6 +690,11 @@ completion--twq-all
                                              'completions-common-part)
                                qprefix))))
                         (qcompletion (concat qprefix qnew)))
+                   ;; Preserve original string with properties if
+                   ;; quoting did not change it.  See bug#61238, which
+                   ;; needs string property preservation.
+                   (when (equal qcompletion completion)
+                     (setq qcompletion completion))
                   ;; FIXME: Similarly here, Cygwin's mapping trips this
                   ;; assertion.
                    ;;(cl-assert





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 18 May 2023 07:11:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 18 03:11:20 2023
Received: from localhost ([127.0.0.1]:51836 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzXnD-0008Pa-Ux
	for submit <at> debbugs.gnu.org; Thu, 18 May 2023 03:11:20 -0400
Received: from mail-pj1-f54.google.com ([209.85.216.54]:62685)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1pzXnB-0008PN-US
 for 61283 <at> debbugs.gnu.org; Thu, 18 May 2023 03:11:18 -0400
Received: by mail-pj1-f54.google.com with SMTP id
 98e67ed59e1d1-2532d6c7ef2so675294a91.0
 for <61283 <at> debbugs.gnu.org>; Thu, 18 May 2023 00:11:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684393872; x=1686985872;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=U9ZLZJazguZsvzJi1yVW4lb9qJhssRc3lBVJri3kEr0=;
 b=r1jG5nY+Iv8dxtqzQLFwSs0WgIFlhNxX0dl8E4CJJ/WOav7ie+kSja2VWY8Ou7Ho/p
 l+z7MHpXl5L9cWqbfmazfXftMCO0BdpFzWovsEEAfhCkjvHH+TjPCKpfkgqCeQ6ztHOU
 dxfWHnfJIoADMoV4UktCu6vYixf4kglCBlGyhvPdyJPFpGce6LBeRFRrzEAov40d6a9X
 ME1hx0uDX6oEu8ege/eo7+ixR87i5g2yoTlqUOXXnC0us4CqDi8iCQ7jbqKPTWGRip3E
 BbKc9Jg+ElMu1vqUhG668n12DzKt6BLV7oRLqtsBHrrvMEkwkv2NvxcszcLrfXurc7dv
 /xxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684393872; x=1686985872;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=U9ZLZJazguZsvzJi1yVW4lb9qJhssRc3lBVJri3kEr0=;
 b=CYxPf0FGT5LHwHx4e0sIpLdf3LrETbqF/ecSyx09X5r3CTCFlpUmieLMhp7VMpTLc/
 PlCG+G+qSgOO0gYG4vUhunvtC8y3h5PLqMFNkgYnk57EDpDIF55c7AeUW84m+UvSEyQw
 YEN7vAWWvUkJW98SrfxevP6MJFWYi/g2fI/J1RH5f7Go5hOLdhSQqHrUUsXb/6kUkORk
 cgTIfW2TqKeouPitq+GY2e1zL5cdPDxs39hIyufRQPT/Shpb6/42Cu4Dw4UWghAJYJpM
 yU65rmYSFJloi2W2Yk9fZqX4vq+NA8Lgb23idGVg3s4Q+wYMjZXGk4Aqr0geR70uGZC5
 rBtg==
X-Gm-Message-State: AC+VfDxsvA4KdZwVi0yMQIJOh+z5ybNzHDxAubaQquHdpRY2pp4Yz7NK
 pS0uSIOlUcQxYYD86o3/kzo=
X-Google-Smtp-Source: ACHHUZ4VrnKqjdNl61jV6npbKQ8X4noXRISECmaZhPjf4QmQBui+w0tY14zOwox0ZJDsRTEYoUsJ9w==
X-Received: by 2002:a17:90b:3e8d:b0:253:4b01:30d with SMTP id
 rj13-20020a17090b3e8d00b002534b01030dmr1554941pjb.11.1684393871997; 
 Thu, 18 May 2023 00:11:11 -0700 (PDT)
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
 s1-20020a17090aa10100b00247164c1947sm4741787pjp.0.2023.05.18.00.11.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 18 May 2023 00:11:11 -0700 (PDT)
Message-ID: <e447e45e-f3b1-586e-40b8-640ec1da007e@HIDDEN>
Date: Thu, 18 May 2023 00:11:09 -0700
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
Content-Language: en-US
To: Stefan Monnier <monnier@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 61283
Cc: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 61283 <at> debbugs.gnu.org, Augusto Stoffel <arstoffel@HIDDEN>,
 liuhui1610@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 5/17/2023 2:20 PM, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> I think the crux of the problem is in:
> 
>                  :annotation-function
>                  (lambda (cand)
>                    (when (stringp cand)
>                      (get-text-property 0 'pcomplete-annotation cand)))
>                  :company-docsig
>                  (lambda (cand)
>                    (when (stringp cand)
>                      (get-text-property 0 'pcomplete-help cand)))
> 
> Rather than fetch the info directly from `cand`, we should maybe
> lookup the info from elsewhere (maybe `completions`?).

Yeah, that's what my patch does.

> Then again, I'm not sure how much `cand` can differ from the matching
> entry in `completions`: it's affected by `completion-table-subvert` and
> `completion-table-with-quoting` so in general it can be non-trivial to
> figure out which entry of `completions` corresponds to the `cand` we
> got :-(

Hmm, yeah. That would be pretty tricky to get working 100% reliably. 
Like Daniel mentions, I think this doesn't come up (often?) for the 
specific case in this bug, but a fully-robust solution would be ideal. 
Maybe the 'metadata' operation[1] would be usable for this with some 
extra work. I'll have to think about this...

... since getting a 100% reliable solution here might take quite a bit 
more work than I thought, how about a not-quite-100% hack? Instead of 
propertizing the first character of each candidate, propertize the 
*last* character (or the entire string?). That won't get thrown out 
quite so easily.

[1] 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Programmed-Completion.html




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 18 May 2023 06:58:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 18 02:58:22 2023
Received: from localhost ([127.0.0.1]:51779 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzXaf-00081z-Ua
	for submit <at> debbugs.gnu.org; Thu, 18 May 2023 02:58:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48948)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pzXaf-00081l-71
 for 61283 <at> debbugs.gnu.org; Thu, 18 May 2023 02:58:21 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pzXaZ-0004ab-29; Thu, 18 May 2023 02:58:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=vvwx5Q88ld7SMmGv0HZzU/2oZtbH/0IaeZIUi8Rz/zo=; b=pG4lV8zpdP1o
 i1/M8bC81Yh+QD6H/0FBx+FyGn39eLw9xhjvAx+suYVMOBYnjlRL3kY2c8XZUQFgDNQbw6AYvjWWx
 8ou2o74FL9cZegh7LbGP/E2FL3K3yE8a5Q8OkQlLaOdHJkbXiasHwZaw20t322Fu6nGyGs20pGPBf
 f6tEErH6TMmblqo17nGhyu+2Se1YOfDsh/t9Di38UXzvRgb0BqOxUiFSIRfDPAn4HEb405oFLfL7w
 2JY3paneVtII2GVj1rDTj1TpVeNl37iiVY2X05Gdttgd4+k3hlUd/uUUevuugNSm6nNbGpyv7Bv7M
 PnCsD/8y+HgenJFvo4UqfA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pzXaY-0002mR-1P; Thu, 18 May 2023 02:58:14 -0400
Date: Thu, 18 May 2023 09:58:25 +0300
Message-Id: <83lehmw2ge.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <3aa0fc03-6d0c-2528-ac3a-f0a815439b15@HIDDEN> (message from
 Jim Porter on Wed, 17 May 2023 23:44:17 -0700)
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
 <3e8bced6-28f8-a0d0-3a74-2907bc241d53@HIDDEN>
 <83sfbuw639.fsf@HIDDEN> <3aa0fc03-6d0c-2528-ac3a-f0a815439b15@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: mail@HIDDEN, 61283 <at> debbugs.gnu.org, arstoffel@HIDDEN,
 monnier@HIDDEN, liuhui1610@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Wed, 17 May 2023 23:44:17 -0700
> Cc: liuhui1610@HIDDEN, arstoffel@HIDDEN, monnier@HIDDEN,
>  61283 <at> debbugs.gnu.org
> From: Jim Porter <jporterbugs@HIDDEN>
> 
> > And why do we have to fix this in Emacs 29.1?  This only affects
> > Eshell, AFAIU, is that true?
> 
> It affects M-x shell for me too. Maybe I'm just doing something wrong 
> though. I tried this:
> 
>    emacs -Q -f shell
>    ls -<TAB>
> 
>  From that, I get completions like "--block-size=", which doesn't show 
> the annotation. With the annotation, it should be "--block-size=SIZE".
> 
> Currently, Pcomplete passes the annotation around by propertizing the 
> first character of the candidate string. That ends up not working, since 
> the completion code uses the characters in the buffer and concats the 
> suffix from Pcomplete. So then the pcomplete-annotation almost always 
> gets thrown out.
> 
> I think a safe (but incomplete) fix would be to put the annotation on 
> the *last* character of the candidate string. Then it usually wouldn't 
> get thrown out. It won't work in *every* case, but it would only fail in 
> rare edge cases.

Maybe that's better.

The other part of "safe" is whether completion--twq-all is called only
when these annotations are needed, or also in other cases.  If the
latter, which use cases the proposed change could affect?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 18 May 2023 06:44:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 18 02:44:29 2023
Received: from localhost ([127.0.0.1]:51754 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzXNF-0007R5-4E
	for submit <at> debbugs.gnu.org; Thu, 18 May 2023 02:44:29 -0400
Received: from mail-pf1-f182.google.com ([209.85.210.182]:48307)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1pzXND-0007Qs-Df
 for 61283 <at> debbugs.gnu.org; Thu, 18 May 2023 02:44:27 -0400
Received: by mail-pf1-f182.google.com with SMTP id
 d2e1a72fcca58-643846c006fso1657127b3a.0
 for <61283 <at> debbugs.gnu.org>; Wed, 17 May 2023 23:44:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684392261; x=1686984261;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=0ZvZfFlxnvOJLe2wf43om2YZVtpOnptkx7GrsRHovzI=;
 b=VT4rUmHRZ8WDrulGqshTtrJyhJG2oN3OvXPI5S0ZqoO0iI+GUWNKGEjuU19DkcQKZI
 SvhtYRkNe5sAdi0pzcfmCmtTgmmYvj2VE5MhvC9afkwiaTD5SbSLjR2QBKJ7eE9zthXl
 QX7p0BRSCXdpLACB8arCH3NaYbZyi/rIjgnK9z5oUr3yPuTIJIfzrroLXQ7/8DMocBAw
 tOw9dw88bR5aAx5gc5Qm/Lq2bi3R/w8ZlNA+ulaiPNWoLMgSxTS6Q6eg4dro0UaPdUW1
 EzjR0nfCVG1yyb+T9sL14jX3EsBbIVcUtCUjax6cCS1JhEB4CzCBmz2webB7U07EZc7H
 tF5g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684392261; x=1686984261;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=0ZvZfFlxnvOJLe2wf43om2YZVtpOnptkx7GrsRHovzI=;
 b=IY2tiGoedo1/F+WXuOES8DyxYrI96LD385EwWudDQWDOL9lHqQAUbwyqPXabHbrb31
 +Gmrn4vb+QV4z3aiGon65LyyPPQjVyUI+T2eHQSHdhMbcPDJwf6L+6fl+mx+Xa9qdOmy
 IRpRs6pRhtw2UEI+9M42So+LPTXhNBZ2Svfz6VBveXx+txMXdLr+cyUBVqYmSOk2ObRu
 JSUycok6NHmE2bUfhUxU0RMhP+x4jl33myUVbBj3jskk3VzeaerTviidN6HdbzGhnAQD
 YoAVROXUod85QstMmQ5KHwjUMvgjhsTKDLqk8n7rU9hdZA9u0W/AzITC2CUDjJFOXxnE
 /lPQ==
X-Gm-Message-State: AC+VfDy54idjqTqmrN4MZ0EY2Nlh+cHbiVrHQbVczXF7+yETlvSCKxuT
 Cv+YncTlO7tIMUT22YTwWiU=
X-Google-Smtp-Source: ACHHUZ53mOMUSjoIqNjfGhfxA016Fft1L/vAPWxKMah3RLNv0l8BU1vvChOtGEI9E0+v2Tp722184Q==
X-Received: by 2002:a05:6a00:18a5:b0:646:6cc3:4a52 with SMTP id
 x37-20020a056a0018a500b006466cc34a52mr3755963pfh.3.1684392261554; 
 Wed, 17 May 2023 23:44:21 -0700 (PDT)
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
 f19-20020aa78b13000000b00637b0c719c5sm575400pfd.201.2023.05.17.23.44.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 17 May 2023 23:44:21 -0700 (PDT)
Message-ID: <3aa0fc03-6d0c-2528-ac3a-f0a815439b15@HIDDEN>
Date: Wed, 17 May 2023 23:44:17 -0700
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>, Daniel Mendler <mail@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
 <3e8bced6-28f8-a0d0-3a74-2907bc241d53@HIDDEN>
 <83sfbuw639.fsf@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <83sfbuw639.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, arstoffel@HIDDEN, monnier@HIDDEN,
 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 5/17/2023 10:39 PM, Eli Zaretskii wrote:
> Why do you think it will be safe for emacs-29?
> 
> And why do we have to fix this in Emacs 29.1?  This only affects
> Eshell, AFAIU, is that true?

It affects M-x shell for me too. Maybe I'm just doing something wrong 
though. I tried this:

   emacs -Q -f shell
   ls -<TAB>

 From that, I get completions like "--block-size=", which doesn't show 
the annotation. With the annotation, it should be "--block-size=SIZE".

Currently, Pcomplete passes the annotation around by propertizing the 
first character of the candidate string. That ends up not working, since 
the completion code uses the characters in the buffer and concats the 
suffix from Pcomplete. So then the pcomplete-annotation almost always 
gets thrown out.

I think a safe (but incomplete) fix would be to put the annotation on 
the *last* character of the candidate string. Then it usually wouldn't 
get thrown out. It won't work in *every* case, but it would only fail in 
rare edge cases.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 18 May 2023 05:39:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 18 01:39:54 2023
Received: from localhost ([127.0.0.1]:51707 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzWMj-00034c-OM
	for submit <at> debbugs.gnu.org; Thu, 18 May 2023 01:39:54 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43470)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pzWMh-00034N-RS
 for 61283 <at> debbugs.gnu.org; Thu, 18 May 2023 01:39:52 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pzWMZ-0008Kz-Nv; Thu, 18 May 2023 01:39:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=QpKqdvGkUFBUwOGoEM4VR3SevMODtXoeu9qnyz+tp6A=; b=Dv9zTV+hlUDv
 50PeGSXGGuzNcX2Z8AvINIzBz1qV+OOkw92e3p07mMfr9Eh4oiMxHnZ4EZ/mDnTk0S1uH4STuQuLo
 musg4MhocpJNaGlrWXBJnouwFxbe/avowdkjQdxWL3bXdZnsfjtp80feTkhDOuP73aCnWV7/4hxE7
 zFj0y3eGDrljOGUWN8+KWgUhmeCg+jo1Dolp14Dj0T+MlfEtCel6RG26yANWJ/ieHI9WpOx/dJWN2
 XuXOMgcEg8ugdAoB51Y+F6Z0bW27/zpjJa8XPB8edtzjbUfvg4sDtWLKI35gndrd72ghElZB64E1S
 c8uAkjT4xq9rVxBcfWfAhA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pzWMZ-0006NR-06; Thu, 18 May 2023 01:39:43 -0400
Date: Thu, 18 May 2023 08:39:54 +0300
Message-Id: <83sfbuw639.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <3e8bced6-28f8-a0d0-3a74-2907bc241d53@HIDDEN> (message
 from Daniel Mendler on Thu, 18 May 2023 04:01:46 +0200)
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
 <3e8bced6-28f8-a0d0-3a74-2907bc241d53@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: jporterbugs@HIDDEN, liuhui1610@HIDDEN, arstoffel@HIDDEN,
 monnier@HIDDEN, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 18 May 2023 04:01:46 +0200
> Cc: Augusto Stoffel <arstoffel@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
>  61283 <at> debbugs.gnu.org, liuhui1610@HIDDEN
> From: Daniel Mendler <mail@HIDDEN>
> 
> Yes, this occurred to me too. I assume relying on the original string
> should work since quoting should not change the string. Options like
> "--color=" are not affected by quoting.
> 
> But this means that the following simple patch to `completion--twq-all'
> also fixes the issue. It ensures that the original string is preserved
> in the common case where string quoting was ineffective. This approach
> may be better than refactoring pcomplete.el. The patch may even be safe
> enough for emacs-29.

Why do you think it will be safe for emacs-29?

And why do we have to fix this in Emacs 29.1?  This only affects
Eshell, AFAIU, is that true?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 18 May 2023 02:01:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 17 22:01:59 2023
Received: from localhost ([127.0.0.1]:51555 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzSxq-0000K4-Qp
	for submit <at> debbugs.gnu.org; Wed, 17 May 2023 22:01:59 -0400
Received: from server.qxqx.de ([178.63.65.180]:47613 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1pzSxn-0000Jp-QO
 for 61283 <at> debbugs.gnu.org; Wed, 17 May 2023 22:01:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
 References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=xBc2XUXsiYFPo5lagiBWl7GZaf/d8EBwvesQHyoQ5q0=; b=Vegoq6OqZkz/YBYNCWKIfHl4Gt
 URtIBxJWjbTAb8Zgtnf0R78HK/dw3Xi43Ek5oHWZmvo91Ydf663afWLUAXkOKcnYYWbEdMiXTqHcT
 iF4kcMnBdDJTaN2OmDVWPMkP+/IbCAUygn8g8FUoOPPB+NdexRn8oJ5naJpUKXe8XjUw=;
Message-ID: <3e8bced6-28f8-a0d0-3a74-2907bc241d53@HIDDEN>
Date: Thu, 18 May 2023 04:01:46 +0200
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
To: Stefan Monnier <monnier@HIDDEN>,
 Jim Porter <jporterbugs@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
 <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
Content-Language: en-US
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Augusto Stoffel <arstoffel@HIDDEN>, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)



On 5/17/23 23:20, Stefan Monnier wrote:
> [ BTW, I just noticed that Augusto (original author of that code) was
>   not in the Cc.  Augusto, you may want to go and read the other
>   messages in bug#61283.  ]
> 
>>> This is obviously a pretty invasive change and would require changing
>>> a number of internal assumptions in Pcomplete (though I don't think it would
>>> break the public API). If this sounds even remotely like a reasonable way to
>>> go forward, I'll try to clean up my patch a bit more and post it for
>>> feedback; it's currently a bit of a mess, I'm afraid...
>>
>> It sounds like a sane approach, so yes, I'd be happy to look at
>> the patch.
>
> Rather than fetch the info directly from `cand`, we should maybe
> lookup the info from elsewhere (maybe `completions`?).  Then again, I'm
> not sure how much `cand` can differ from the matching entry in
> `completions`: it's affected by `completion-table-subvert` and
> `completion-table-with-quoting` so in general it can be non-trivial to
> figure out which entry of `completions` corresponds to the `cand` we
> got :-(

Yes, this occurred to me too. I assume relying on the original string
should work since quoting should not change the string. Options like
"--color=" are not affected by quoting.

But this means that the following simple patch to `completion--twq-all'
also fixes the issue. It ensures that the original string is preserved
in the common case where string quoting was ineffective. This approach
may be better than refactoring pcomplete.el. The patch may even be safe
enough for emacs-29.

From: Daniel Mendler <mail@HIDDEN>
Date: Wed, 17 May 2023 10:23:25 +0200
Subject: [PATCH] Preserve pcomplete annotation and help (bug#61283)

lisp/minibuffer.el (completion--twq-all): Preserve string properties
in if quoted string equals original string.
---
 lisp/minibuffer.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 747c9443af..804c5d38ca 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -690,6 +690,11 @@ completion--twq-all
                                              'completions-common-part)
                                qprefix))))
                         (qcompletion (concat qprefix qnew)))
+                   ;; Preserve original string with properties if
+                   ;; quoting did not change it.  See bug#61238, which
+                   ;; needs string property preservation.
+                   (when (equal qcompletion completion)
+                     (setq qcompletion completion))
                   ;; FIXME: Similarly here, Cygwin's mapping trips this
                   ;; assertion.
                    ;;(cl-assert





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 17 May 2023 21:21:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 17 17:21:03 2023
Received: from localhost ([127.0.0.1]:51248 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzOZy-0001aE-Qr
	for submit <at> debbugs.gnu.org; Wed, 17 May 2023 17:21:03 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3559)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1pzOZw-0001ZO-Vm
 for 61283 <at> debbugs.gnu.org; Wed, 17 May 2023 17:21:01 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4A8AA1000DD;
 Wed, 17 May 2023 17:20:55 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D131A100048;
 Wed, 17 May 2023 17:20:53 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1684358453;
 bh=yh9uNlZtblsYYdHx3FN7yKypSdMlmJbgs5onVXAbrZ4=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=M7LBlQkkmTAJpYTfESg02ifz7FrrXESbekkr72UTQaVYf9pBzmDRlZRhEIxe/FcUn
 lPUH9J8RiHqVPlowdRNTG6EhE1IxDmQZyOExVbbwMEb/jF/FaVmTItMXyR+Pja05oP
 QftazJbHIUEqfTTrs7tn1TulqKeeG3aTIL68OB14cJxPEY1J/hr2SiXq6U1JxpuJDj
 LhUKZ0Ux42gSrhkx9Fw22giJjNN8pOnDy4o5pmJnLl138AAVOxto/h5BXU/YoNb/4P
 7+x9AmmjNbcnexBHpEN1LXj9JXc5B1FEAgroU+Cmct4hqhsAsyGd/r1MpHr8zVMK4v
 hleFXJvZ2XkdQ==
Received: from pastel (unknown [45.72.217.176])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 98BDC12034D;
 Wed, 17 May 2023 17:20:53 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
In-Reply-To: <jwv353vatyu.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Wed, 17 May 2023 10:55:38 -0400")
Message-ID: <jwvcz2yy8gs.fsf-monnier+emacs@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
 <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
Date: Wed, 17 May 2023 17:20:52 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.186 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 liuhui1610@HIDDEN, Augusto Stoffel <arstoffel@HIDDEN>,
 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[ BTW, I just noticed that Augusto (original author of that code) was
  not in the Cc.  Augusto, you may want to go and read the other
  messages in bug#61283.  ]

>> This is obviously a pretty invasive change and would require changing
>> a number of internal assumptions in Pcomplete (though I don't think it would
>> break the public API). If this sounds even remotely like a reasonable way to
>> go forward, I'll try to clean up my patch a bit more and post it for
>> feedback; it's currently a bit of a mess, I'm afraid...
>
> It sounds like a sane approach, so yes, I'd be happy to look at
> the patch.

Augusto's code relies on storing the info as text properties on the
first char of completion candidates and then making sure it's properly
preserved/propagated, and this is indeed generally risky (not dangerous,
but it's an information that's easily lost).

I think the crux of the problem is in:

                :annotation-function
                (lambda (cand)
                  (when (stringp cand)
                    (get-text-property 0 'pcomplete-annotation cand)))
                :company-docsig
                (lambda (cand)
                  (when (stringp cand)
                    (get-text-property 0 'pcomplete-help cand)))

Rather than fetch the info directly from `cand`, we should maybe
lookup the info from elsewhere (maybe `completions`?).  Then again, I'm
not sure how much `cand` can differ from the matching entry in
`completions`: it's affected by `completion-table-subvert` and
`completion-table-with-quoting` so in general it can be non-trivial to
figure out which entry of `completions` corresponds to the `cand` we
got :-(


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 17 May 2023 14:55:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 17 10:55:48 2023
Received: from localhost ([127.0.0.1]:50626 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzIZA-0006HK-4A
	for submit <at> debbugs.gnu.org; Wed, 17 May 2023 10:55:48 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22556)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1pzIZ8-0006H2-Uy
 for 61283 <at> debbugs.gnu.org; Wed, 17 May 2023 10:55:47 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 501FC1000BE;
 Wed, 17 May 2023 10:55:41 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 13C51100048;
 Wed, 17 May 2023 10:55:40 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1684335340;
 bh=Y8WYmTwtz/hfbADlEHVPszGlwaJACS4Y1jbFQaNexFU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=cxQiFmn3Dh6gdVz6zlA5zh9PGzRPb1teqy1uaAAcLQOZ/cGrhrKAzZU2mP5sWMxd2
 0qFnnBWenm3L+RIT1Xd4qWlr4FKDhnMF55/QO5z1MtBmlCj23ipzw+ya/DGdDZ5+Zb
 I0s2rT7D8U2pdGkD3Z3vmCvcwNMYyyALQBU+28Rb84S08c8uuRzGgrziZg6Sq2Rj5h
 236jKhNo95XZydwNt6XbIJ7nsiwy4XGOevOeOKbc3KqC93yYzdDHFNw9WjvMN4RolI
 ypR0hXm6PMAqJRWZeNp1DnZrjYjBuNUgfZQO5TkLnTTnsD8/EJyrLlHQ/zCmFguYtZ
 RMQGpmR/q6zeg==
Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CC4A0120491;
 Wed, 17 May 2023 10:55:39 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
In-Reply-To: <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN> (Jim Porter's
 message of "Tue, 16 May 2023 22:45:42 -0700")
Message-ID: <jwv353vatyu.fsf-monnier+emacs@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
Date: Wed, 17 May 2023 10:55:38 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.061 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 61283 <at> debbugs.gnu.org, liuhui1610@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> This is obviously a pretty invasive change and would require changing
> a number of internal assumptions in Pcomplete (though I don't think it would
> break the public API). If this sounds even remotely like a reasonable way to
> go forward, I'll try to clean up my patch a bit more and post it for
> feedback; it's currently a bit of a mess, I'm afraid...

It sounds like a sane approach, so yes, I'd be happy to look at
the patch.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 17 May 2023 07:25:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 17 03:25:10 2023
Received: from localhost ([127.0.0.1]:48741 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzBX4-0001SR-Fr
	for submit <at> debbugs.gnu.org; Wed, 17 May 2023 03:25:10 -0400
Received: from server.qxqx.de ([178.63.65.180]:53663 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1pzBX2-0001Ry-1M
 for 61283 <at> debbugs.gnu.org; Wed, 17 May 2023 03:25:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
 References:Cc:To:From:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=DdxNkbtiSNDf+vOQA6vafuuUxg1iTBIixdF9mJrYKZg=; b=qoIunRPvc2NiLTY72MLv5BKlH4
 M16v8fxq5fr9H52nmspmArxtFi5BDO5HRFKF5291YIzLGooEb2xMzdvFZivycbEIo7PwPz7zsPmlG
 6k+pso0lsoqe6kV018ic/6r5x+D/qH0rbcnYsPBhf+Jm8vM7nyknIwEER/reFkigxhm0=;
Message-ID: <3356151a-354f-239f-7a52-4bd3813ce5c3@HIDDEN>
Date: Wed, 17 May 2023 09:24:59 +0200
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
From: Daniel Mendler <mail@HIDDEN>
To: Gregory Heytings <gregory@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <6ca1bd5ed08c9138c9b5@HIDDEN>
 <7122c179-e105-0b04-fed0-08c30638660a@HIDDEN>
Content-Language: en-US
In-Reply-To: <7122c179-e105-0b04-fed0-08c30638660a@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 monnier@HIDDEN, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)



On 5/17/23 08:15, Daniel Mendler wrote:
> On 5/16/23 23:37, Gregory Heytings wrote:
>>> I just tried again and it seems the annotations work only in Shell but 
>>> not in Eshell. This is probably the reason why the issue was missed. In 
>>> Eshell the functionality never worked as intended after it got 
>>> installed. I didn't mean to exaggerate.
>>>
>>
>> Yet ISTM that claiming that "the pcomplete help functionality never worked 
>> properly" is an exaggeration.  The feature is 'pcomplete-from-help', which 
>> extracts completion candidates from --help outputs, and is works (or 
>> mostly works).  A subfeature of that feature are the annotations, and 
>> these annotations do not work in one particular case, eshell.
> 
> Why does it matter? For me the feature never worked in the one single
> use case relevant to me, namely Eshell. Calling this a "subfeature" can
> then be considered an exaggeration as well - the purpose of
> pcomplete-from-help is to provide annotations and documentation in the
> echo area via :company-docsig. If this "subfeature" doesn't work, the
> feature doesn't work.

I have to correct myself. I looked at pcomplete-from-help again and it
also retrieves all the completion candidates from the help text and not
only the annotations. So saying that the feature does not work is indeed
an exaggeration - only the annotations do not work with Eshell. I apologize!

Daniel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 17 May 2023 06:31:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 17 02:31:28 2023
Received: from localhost ([127.0.0.1]:48655 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzAh6-0008OU-HX
	for submit <at> debbugs.gnu.org; Wed, 17 May 2023 02:31:28 -0400
Received: from server.qxqx.de ([178.63.65.180]:41319 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1pzAh4-0008OE-65
 for 61283 <at> debbugs.gnu.org; Wed, 17 May 2023 02:31:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
 References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=cm6lYSmxtYgfyRhnZt1MyahXUzutUMsEoKnRfc+zrXw=; b=rp2MnwaqfpZP8gIDs95liyvGLy
 +g4k8C+IQQIyY71gdEXTnjAybyTkOIGebzPsgoCFEV3a4Rz64TN5TwWWX/vw2I6FBOwiqwDoaxJEa
 Z3sDJ4h2UzrmOPjIz1OHHbqz/nM+lvflzsuduwQFaEB4hmy1XrZdV9wei1Rd83g77x+0=;
Message-ID: <f6e93c6f-b1e2-98a1-20f3-ed42b903c98b@HIDDEN>
Date: Wed, 17 May 2023 08:31:18 +0200
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
To: Jim Porter <jporterbugs@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
Content-Language: en-US
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, monnier@HIDDEN, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 5/17/23 07:45, Jim Porter wrote:
> I do have a mostly-complete patch for this though, but it's *certainly* 
> too complex for Emacs 29. The general strategy I'm using is to rely on 
> the fact that the completion list for 'try-completion', etc can be an 
> alist where the "keys" (i.e the CAR of each element of the main list) 
> are the strings to be completed. So then you can do something like:
> 
>    '(("foo" (pcomplete-annotation . "=bar"))
>      ;; ...
>      )
> 
> Then, in 'pcomplete-completions-at-point', I can get the annotations[1] 
> in the :annotation-function on the completion table that we return.
> 
> This is obviously a pretty invasive change and would require changing a 
> number of internal assumptions in Pcomplete (though I don't think it 
> would break the public API). If this sounds even remotely like a 
> reasonable way to go forward, I'll try to clean up my patch a bit more 
> and post it for feedback; it's currently a bit of a mess, I'm afraid...

Thank you. Carrying the annotation and echo information as part of an
alist seems like a good approach, since interference with the candidate
strings cannot lead to problems. Ideally the candidate strings would not
get modified like this by the `completion-table-with-quoting', but that
may be unavoidable given the nature of `completion-table-with-quoting'.
If the modification is too complex, Emacs 29 is of course not the right
place for it.

Daniel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 17 May 2023 06:16:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 17 02:16:11 2023
Received: from localhost ([127.0.0.1]:48622 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pzASG-0007zw-5B
	for submit <at> debbugs.gnu.org; Wed, 17 May 2023 02:16:11 -0400
Received: from server.qxqx.de ([178.63.65.180]:53589 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1pzASA-0007zK-HO
 for 61283 <at> debbugs.gnu.org; Wed, 17 May 2023 02:16:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
 References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=R7p18aZKnjHNZ8EEKP15cK+6lnwgbHLyqx5GM0ejCg0=; b=RGxDpKcKma8hKcCqXDyYub/Fd2
 s7hx4HflOVLi8OTKeJlBfVoYmNkoHDLhqtbhbjDmn01CuLad4u2WTuqAYPTrAMjs2wyBYi0oVCtw8
 dkPZpjsai63UsEW7tu5XFUuMmCV952YuVcT1aPWLHbWtUe4vD2vyPOVjlRs/4osy0jWE=;
Message-ID: <7122c179-e105-0b04-fed0-08c30638660a@HIDDEN>
Date: Wed, 17 May 2023 08:15:54 +0200
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
To: Gregory Heytings <gregory@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
 <6ca1bd5ed08c9138c9b5@HIDDEN>
Content-Language: en-US
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <6ca1bd5ed08c9138c9b5@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 monnier@HIDDEN, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 5/16/23 23:37, Gregory Heytings wrote:
>> I just tried again and it seems the annotations work only in Shell but 
>> not in Eshell. This is probably the reason why the issue was missed. In 
>> Eshell the functionality never worked as intended after it got 
>> installed. I didn't mean to exaggerate.
>>
> 
> Yet ISTM that claiming that "the pcomplete help functionality never worked 
> properly" is an exaggeration.  The feature is 'pcomplete-from-help', which 
> extracts completion candidates from --help outputs, and is works (or 
> mostly works).  A subfeature of that feature are the annotations, and 
> these annotations do not work in one particular case, eshell.

Why does it matter? For me the feature never worked in the one single
use case relevant to me, namely Eshell. Calling this a "subfeature" can
then be considered an exaggeration as well - the purpose of
pcomplete-from-help is to provide annotations and documentation in the
echo area via :company-docsig. If this "subfeature" doesn't work, the
feature doesn't work.

I had experimented before with different approaches to generate help
information. There exists the package pcmpl-args
(https://elpa.nongnu.org/nongnu/pcmpl-args.html) which works in both
Shell and Eshell and I had hoped that the new pcomplete-from-help
feature would replace that in a clean way.

However there is another small difference between pcmpl-args and
pcomplete-from-help. pcmpl-args also shows the help text as part of the
annotation and not in the echo area. Augusto told me that he considers
such a long annotation text as default as too intrusive. Maybe the
annotation formatting could be configured to include either the only the
option value (the [VALUE] of --option=[VALUE]) or both the value and the
help text. Another alternative is to use some mechanism which translates
:company-docsig to an :annotation-function. This could either be done by
wrapping the Capf or on the level of the completion UI.

Daniel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 17 May 2023 05:45:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 17 01:45:53 2023
Received: from localhost ([127.0.0.1]:48567 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pz9yy-0006yJ-Vf
	for submit <at> debbugs.gnu.org; Wed, 17 May 2023 01:45:53 -0400
Received: from mail-pl1-f173.google.com ([209.85.214.173]:51553)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1pz9yv-0006y1-H3
 for 61283 <at> debbugs.gnu.org; Wed, 17 May 2023 01:45:51 -0400
Received: by mail-pl1-f173.google.com with SMTP id
 d9443c01a7336-1aad5245632so3220175ad.3
 for <61283 <at> debbugs.gnu.org>; Tue, 16 May 2023 22:45:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684302343; x=1686894343;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=Jf3DfUUNn5tQkMGW9K1icU9oIpF4zLDC5xo/Q4lKy6E=;
 b=m3H3zXOmxF44Tpb8Wijc0bPOiDlyhlj2HCeCltiwRj9vaBzs5HgbzTm5k4Ck6A+C0U
 u1en3nmZjnP/CzL4jNxwsUsrPu//mpUYwkUoib/hGM0iT3dAEuWTbACzx6tk4nXsr8ga
 OuaGTs3CH9FnHCmn0oEaGSKRDU/Tq35OkUp77Y9oMgu8ipgGBAMQCZv4QX9sMpjYHzAq
 FDjR3qsUEDlezElowadPszzGfEr88vJ5viPi+AQ41hTrdH7qExzrLAdqlRWtgox95Cxd
 tkbzECkstjVor9rQ+Hrp2l5nLw/HQFyEf9rRbZiCNgdhtGDvHttRr08ex/pagPfyRI/X
 w/PQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684302343; x=1686894343;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=Jf3DfUUNn5tQkMGW9K1icU9oIpF4zLDC5xo/Q4lKy6E=;
 b=goH0t52xUUs2x4GkUpapoWn1KjAEq8QTjR9+D72isN8XKWwfeml2a9U0qmPKnVYqaL
 z3sbBd9TzvE91EEl+2r6P06iFKMUktT+nXD/vjYr3Z57Dj433bsruU9eQTmOOtlfg4kj
 14FMmnSIyp3m1Cgjh3yn6WlNlg3BcpPJkoYuOdnuxL+9iWkF82YmiJy4VDxwueng5Xx6
 ukqlIo8EcI2M8MTKqCVlTG23RN15GfvkdXkAWrPsWgEMRNDbb6ZSD2L6O/XnzEKCP94R
 1Xg6xD/ebDsM0T827hcplQrTYzDWs0MBL7EqV+ytzpilMnWZFvZ8pDpPWaqK6KhZ9chN
 cSGg==
X-Gm-Message-State: AC+VfDzA+IPaJItg2+7tfo1B2uBncvvds34CWg20ZMSTNiWgjBZBlNog
 i78LvNHg8JSlZjOf+L9zTv0=
X-Google-Smtp-Source: ACHHUZ6jNm9cj05LacMchMhPdlKf0aVHgnwMj+aTKXth9JwJ/EyUqtpVp7uJaXz+6YHL4Pld42HYcQ==
X-Received: by 2002:a17:902:9a04:b0:1ad:bccc:af78 with SMTP id
 v4-20020a1709029a0400b001adbcccaf78mr24918403plp.58.1684302343251; 
 Tue, 16 May 2023 22:45:43 -0700 (PDT)
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
 d8-20020a170902654800b001ae48d441desm1357995pln.148.2023.05.16.22.45.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 16 May 2023 22:45:42 -0700 (PDT)
Message-ID: <d677cac6-7994-2338-cabc-6101669ad5ae@HIDDEN>
Date: Tue, 16 May 2023 22:45:42 -0700
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
Content-Language: en-US
To: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, monnier@HIDDEN, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 5/16/2023 3:44 AM, Daniel Mendler wrote:
> I just tried again and it seems the annotations work only in Shell but
> not in Eshell. This is probably the reason why the issue was missed. In
> Eshell the functionality never worked as intended after it got
> installed. I didn't mean to exaggerate.
> 
> - M-x shell -> Type ls - TAB -> Annotations are displayed
> - M-x eshell -> Type ls - TAB -> No annotations

I don't see annotations in either shell or eshell. Am I doing something 
wrong? From "emacs -Q -f shell", I type "ls -" and press TAB.

I do have a mostly-complete patch for this though, but it's *certainly* 
too complex for Emacs 29. The general strategy I'm using is to rely on 
the fact that the completion list for 'try-completion', etc can be an 
alist where the "keys" (i.e the CAR of each element of the main list) 
are the strings to be completed. So then you can do something like:

   '(("foo" (pcomplete-annotation . "=bar"))
     ;; ...
     )

Then, in 'pcomplete-completions-at-point', I can get the annotations[1] 
in the :annotation-function on the completion table that we return.

This is obviously a pretty invasive change and would require changing a 
number of internal assumptions in Pcomplete (though I don't think it 
would break the public API). If this sounds even remotely like a 
reasonable way to go forward, I'll try to clean up my patch a bit more 
and post it for feedback; it's currently a bit of a mess, I'm afraid...

[1] Ditto for 'pcomplete-help' and the :company-docsig function.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 16 May 2023 21:37:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 16 17:37:57 2023
Received: from localhost ([127.0.0.1]:48197 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pz2Mn-0001CT-Ft
	for submit <at> debbugs.gnu.org; Tue, 16 May 2023 17:37:57 -0400
Received: from heytings.org ([95.142.160.155]:35840)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1pz2Ml-0001CK-EO
 for 61283 <at> debbugs.gnu.org; Tue, 16 May 2023 17:37:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1684273074;
 bh=cflHCMfW+Yll5vU/IhJ5p2rSsGGrPnH6u1PkrcL7R9A=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=MLshgzlpSCyQc2w/NPU24B+4M4bPU/H/ifvkX8EKwNZwXNwixR7wTpobzdG+wNccy
 jpemPpRiIWxKn/wiFWcEM7TgNMSAxMSxYdUdKtY/S6uhrSNdhC4GBjXBfXzZkzWAm5
 2PjIOTxzagOonZIVQcGhVOp/AdaM5Us/PmU2pzAaKd1ucA+GczRqb4x+khQbCFhQTq
 yp8M6fc46SdrnmsrB6HNtiP0zwH9JH+rGl2FZDEEQWVCyOGJkjrgrHiPDL/cIjq70X
 N3nx0X9QSyjfnszjNiF092LFyikVgN6VgkEUaBvOvuHTdDqClvWboT81X8ZmWp/I6h
 Bug/7tGBNKonA==
Date: Tue, 16 May 2023 21:37:53 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
In-Reply-To: <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
Message-ID: <6ca1bd5ed08c9138c9b5@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
 <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=us-ascii
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 monnier@HIDDEN, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>
> I just tried again and it seems the annotations work only in Shell but 
> not in Eshell. This is probably the reason why the issue was missed. In 
> Eshell the functionality never worked as intended after it got 
> installed. I didn't mean to exaggerate.
>

Yet ISTM that claiming that "the pcomplete help functionality never worked 
properly" is an exaggeration.  The feature is 'pcomplete-from-help', which 
extracts completion candidates from --help outputs, and is works (or 
mostly works).  A subfeature of that feature are the annotations, and 
these annotations do not work in one particular case, eshell.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 16 May 2023 14:04:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 16 10:04:27 2023
Received: from localhost ([127.0.0.1]:46841 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pyvHv-0008Tt-J4
	for submit <at> debbugs.gnu.org; Tue, 16 May 2023 10:04:27 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:26086)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1pyvHs-0008Td-IO
 for 61283 <at> debbugs.gnu.org; Tue, 16 May 2023 10:04:25 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E89801000C4;
 Tue, 16 May 2023 10:04:18 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6D68B1000BD;
 Tue, 16 May 2023 10:04:17 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1684245857;
 bh=22/01lrhTq/DaqKszzA+0uT2I0/szUM33IQdQCTF/GE=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Y1ZZkYkXLN5xG0EbesIKMSpNOLaOMvg6p5AnnxBjWCyj+3Bu79O6TSbcY4R2MxVXz
 +kvhXQm5y0eF6T5B3Ow/0qXt6EzYTRfGHT+/3hpgIE7jIweGwCZ6iNWTWLoLbhEycd
 hcP1peunAEZnyzu1b1VSlgKQG3xo4tfGDBg5rVlxVXqcmfHeOVStQVR2FC+b+5Jgl2
 f4hB7KrVBd7m6fTbepUvaeEN5QXxI+AM62vXNvGRAV7rEeqAjTVYHsr6yMVtuzEEr1
 fYp03zSE/Sc4gDp+d52MBiWgaZViLEN2zvJmn3VecX4foUk9T+o8f7Rayw4j8HXHkL
 yBegC4i2A8jew==
Received: from pastel (unknown [45.72.217.176])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 429B7120DB7;
 Tue, 16 May 2023 10:04:17 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Liu Hui <liuhui1610@HIDDEN>
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
In-Reply-To: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 (Liu Hui's message of "Tue, 16 May 2023 09:49:00 +0800")
Message-ID: <jwvwn18z86p.fsf-monnier+emacs@HIDDEN>
References: <87cz6px8mw.fsf@HIDDEN>
 <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
Date: Tue, 16 May 2023 10:04:15 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.190 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: "mail@HIDDEN" <mail@HIDDEN>, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
> index a3dc1b0cfbf..b0c32b938a0 100644
> --- a/lisp/minibuffer.el
> +++ b/lisp/minibuffer.el
> @@ -700,6 +700,7 @@ completion--twq-all
>             ;;  (concat (substring ustring 0 boundary)
>             ;;          completion))
>             ;; t)
> +                   (add-text-properties 0 1 (text-properties-at 0
> completion) qcompletion)
>                     qcompletion))
>                 completions)
>         qboundary))))
>
> It just re-adds text properties to completions produced by
> `completion-table-with-quoting', but I'm not sure it is the proper
> fix.  What do you think?

For some properties, this may do The Wrong Thing :-(
E.g. it could copy some `display` properties to an unrelated part of
the text.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 16 May 2023 10:45:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 16 06:45:02 2023
Received: from localhost ([127.0.0.1]:45307 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pysAw-0008Cv-23
	for submit <at> debbugs.gnu.org; Tue, 16 May 2023 06:45:02 -0400
Received: from server.qxqx.de ([178.63.65.180]:47851 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1pysAr-0008C6-4w
 for 61283 <at> debbugs.gnu.org; Tue, 16 May 2023 06:45:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
 References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=3oc9dGVeEUW9vwTHNyXLyEcNGCfcVSF/v6k2hUAce7I=; b=mUyeg4s8umCPo2QVdeFxBF6m8G
 /IE1dZxV9wjVSe2gh8c9xMZ62F6QinxcvvyR79hL6oX6VG905C2pewmTE+FJ+5/XZntH4MnLBsDNu
 iav7rEWiWYOz39oR7jyirjwsWteDITFLo16rU+JpW37CA7opAT+RYY6zVPparCd5NVaQ=;
Message-ID: <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@HIDDEN>
Date: Tue, 16 May 2023 12:44:48 +0200
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
 <83zg64zhyx.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <83zg64zhyx.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, monnier@HIDDEN, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)



On 5/16/23 12:30, Eli Zaretskii wrote:
>> Date: Tue, 16 May 2023 08:19:52 +0200
>> Cc: 61283 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
>>  Eli Zaretskii <eliz@HIDDEN>
>> From: Daniel Mendler <mail@HIDDEN>
>>
>> Eli, are you okay with adding a fix for this problem to emacs-29?
> 
> I'd need to see an actual patch to answer that.  It depends on where
> in the code will the fix be and how likely it will be to affect
> unrelated parts of the functionality.
> 
>> The pcomplete help functionality is new functionality introduced in
>> Emacs 29, but it never worked properly, it seems.
> 
> I think "never worked properly" is a bit of an exaggeration, since I'd
> assume it does "mostly" work, otherwise it would not have been
> installed.  Some parts of the functionality are not working, but I'm
> not yet sure how important those parts are, relative to the rest.

I just tried again and it seems the annotations work only in Shell but
not in Eshell. This is probably the reason why the issue was missed. In
Eshell the functionality never worked as intended after it got
installed. I didn't mean to exaggerate.

- M-x shell -> Type ls - TAB -> Annotations are displayed
- M-x eshell -> Type ls - TAB -> No annotations

Daniel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 16 May 2023 10:30:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 16 06:30:34 2023
Received: from localhost ([127.0.0.1]:45295 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pyrwv-0007qG-Ra
	for submit <at> debbugs.gnu.org; Tue, 16 May 2023 06:30:34 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45386)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pyrws-0007px-Nd
 for 61283 <at> debbugs.gnu.org; Tue, 16 May 2023 06:30:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pyrwm-00024y-AR; Tue, 16 May 2023 06:30:24 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=/B7ZQP6phvXBBePXkKVINbF7RGrFkG7yqxgH6lsV0oM=; b=dtT7Zti0gA1X
 JMpaHcpUMJdlJrnltjkpl4q/dVloGlRZV1ZYhcCsHN5Dkw9vtg86mSjmPDOulkvBqtg3SQma8C03y
 9didevh2/ajAB2yAvNUOTUTR/DTzMv2C1cBryXEMoORnE/vBul7E0FD1OTSoJ4NvAQjIcberSWSrG
 Sgsm7HTYku121zCQ7FGtVxjJ4ooN9nap8AAP6vU0NQuLv7C1wBoXCnlqgd/9cMFsctEJFW4/WPbBV
 hrt4uqFOkud1+R9kxgNtuZ7ZYTRVR3GGIZjbhJsBqL/7RWVvV+5yh2qYz6qUoJNExUjc096WQXt5t
 MgLpBwaTmCAb76KH0bKKGA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pyrwl-0007l0-Pd; Tue, 16 May 2023 06:30:24 -0400
Date: Tue, 16 May 2023 13:30:30 +0300
Message-Id: <83zg64zhyx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN> (message
 from Daniel Mendler on Tue, 16 May 2023 08:19:52 +0200)
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
 <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: liuhui1610@HIDDEN, monnier@HIDDEN, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 16 May 2023 08:19:52 +0200
> Cc: 61283 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
>  Eli Zaretskii <eliz@HIDDEN>
> From: Daniel Mendler <mail@HIDDEN>
> 
> Eli, are you okay with adding a fix for this problem to emacs-29?

I'd need to see an actual patch to answer that.  It depends on where
in the code will the fix be and how likely it will be to affect
unrelated parts of the functionality.

> The pcomplete help functionality is new functionality introduced in
> Emacs 29, but it never worked properly, it seems.

I think "never worked properly" is a bit of an exaggeration, since I'd
assume it does "mostly" work, otherwise it would not have been
installed.  Some parts of the functionality are not working, but I'm
not yet sure how important those parts are, relative to the rest.

So this is a judgment call, and I need to see the patch to make the
decision.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 16 May 2023 07:50:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 16 03:50:26 2023
Received: from localhost ([127.0.0.1]:45077 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pypRw-0000JK-Uw
	for submit <at> debbugs.gnu.org; Tue, 16 May 2023 03:50:26 -0400
Received: from heytings.org ([95.142.160.155]:35052)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1pypRr-0000J4-Fv
 for 61283 <at> debbugs.gnu.org; Tue, 16 May 2023 03:50:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1684223418;
 bh=T7SdAst8ObHntBh7knMGHsOcPNO06vE2wXugAiIBbQw=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=GJ1KDgZJp9F/IQbje1AEqGxS6Lza1H9XTKZCXC4MeMn2NB008B3rhxVVX91ZNvMxs
 LTN/l+2vMVs3LegXXOEnMNQbwLby7JUZGjdVJQNY6gHTXoDpYC1BQ8XQ3LfLqFsZoo
 DPPFDELDRl0k7jjonCRp932SwH22tCLd+6Kk0YfR4XLlhh3nhdHg/FxOdG8/5+1FWq
 fhZ/kA5qLaiUot6wRYYnUUi1ICW8cxVc1r7cYworY7cx+BKJYCM7MF5YEwmWcanSvn
 yId3IuicJKdklhJsR6HUdqE2/FWqOIhpRHlKO54Dq7CkR74TQm50idOaycWGVkWs39
 l6YoEhXg2LqKg==
Date: Tue, 16 May 2023 07:50:17 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
In-Reply-To: <87cz6px8mw.fsf@HIDDEN>
Message-ID: <6ca1bd5ed01d0f0225a7@HIDDEN>
References: <87cz6px8mw.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=us-ascii
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 61283
Cc: arstoffel@HIDDEN, monnier@HIDDEN, 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>
> 1. Start emacs -Q
> 2. Evaluate the following two test commands in the scratch buffer:
>
> (defun good ()
>  (interactive)
>  (pp (all-completions "" (nth 2 (pcomplete-completions-at-point)))))
>
> (defun bad ()
>  (interactive)
>  (pp (all-completions "-" (nth 2 (pcomplete-completions-at-point)))))
>
> 3. Run shell or eshell
> 4. Enter `xargs --' in order to complete command line options via
> `pcomplete-from-help'.
> 5. M-x good -> Printed completion strings will have pcomplete-annotation
> and pcomplete-help text properties. These are used by the
> :annotation-function and the :company-docsig function.
> 6. M-x bad -> Returned completion strings are stripped of their text
> properties.
> 7. When triggering completion manually by pressing TAB, there are
> no annotations displayed in the *Completions* buffer.
>
> If I recall correctly, this functionality worked at some point and the 
> text properties were not removed, such that annotations worked. The 
> culprit, which destroys the properties, seems to be 
> `completion-table-with-quoting' in `pcomplete-completions-at-point', but 
> I wasn't able to figure out which commit caused this (I did not do any 
> bisecting).
>

Sorry, I missed your earlier post.  There is no need to bisect in this 
case: 'pcomplete-from-help' was added in a994126968 (which means that it's 
new in Emacs 29), and the recipe above already gave the exact same result 
at that point.  I took a sample of four revisions between 
emacs-29/c18f9f155f and a994126968 (f102145d38, 07127e9c29, 4f114c0d95, 
809afde01d), and the result is always the same.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 16 May 2023 06:20:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 16 02:20:05 2023
Received: from localhost ([127.0.0.1]:45031 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pyo2X-000679-1h
	for submit <at> debbugs.gnu.org; Tue, 16 May 2023 02:20:05 -0400
Received: from server.qxqx.de ([178.63.65.180]:34483 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1pyo2S-00066O-O1
 for 61283 <at> debbugs.gnu.org; Tue, 16 May 2023 02:20:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
 References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=XKQaOk9tidB9CXviOBCdX1V6OWwRfmF3hicEvfz2kDw=; b=hbxnKetVLoyz8G9At8+puwiABs
 +P3DWEDO4MJgwFB3Xzh1N02lFZpTldEz95jV9X2JwyXVjT9Ql4a6/ybig3GSGYhUPqOT6zO4iPczV
 mybd3keadx/HhLJzN4X9Txeo0faHw/SptcZfxbdrVF0vQNIR4rkfiSA6D9wGdV2WomvQ=;
Message-ID: <2eb987c6-0aec-55df-db4e-ef95557ab809@HIDDEN>
Date: Tue, 16 May 2023 08:19:52 +0200
MIME-Version: 1.0
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
To: Liu Hui <liuhui1610@HIDDEN>
References: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
Content-Language: en-US
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61283
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 5/16/23 03:49, Liu Hui wrote:
> I agree that completion-table-with-quoting is responsible.
> pcomplete-annotation and pcomplete-help text properties can be
> successfully shown by the completion UI (corfu/company) by applying
> the following patch:
>
> It just re-adds text properties to completions produced by
> `completion-table-with-quoting', but I'm not sure it is the proper
> fix. What do you think?

I wonder when the regression was introduced. Maybe this could help to
pin down the problem and give a hint at the proper fix. I cc'ed Stefan,
since he can judge better if the proposed fix is good. I would at least
add a comment, explaining why the properties are copied.

Eli, are you okay with adding a fix for this problem to emacs-29? The
pcomplete help functionality is new functionality introduced in Emacs
29, but it never worked properly, it seems.

Daniel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at 61283 <at> debbugs.gnu.org:


Received: (at 61283) by debbugs.gnu.org; 16 May 2023 01:49:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 15 21:49:20 2023
Received: from localhost ([127.0.0.1]:44748 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pyjoV-0006SP-WD
	for submit <at> debbugs.gnu.org; Mon, 15 May 2023 21:49:20 -0400
Received: from mail-oa1-f41.google.com ([209.85.160.41]:49520)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liuhui1610@HIDDEN>) id 1pyjoT-0006SC-Ri
 for 61283 <at> debbugs.gnu.org; Mon, 15 May 2023 21:49:18 -0400
Received: by mail-oa1-f41.google.com with SMTP id
 586e51a60fabf-199bcf78252so1924251fac.3
 for <61283 <at> debbugs.gnu.org>; Mon, 15 May 2023 18:49:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684201752; x=1686793752;
 h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=vCURr7Mv2ZvRpvvZLV/hru8m0KteklJRIVmRynPxVng=;
 b=JhkGBjsslaTPqBIBM99rlVzWumsUTY2GaR1dfynqaj5mMOjaCbqww/1C2mzvgSfHr/
 /FWGsMgVoLUh7TxTpp1e4YHmhAkdqHUWlcDb/2wY869shr3swPFmPrc8tZR75VvDI515
 RxtTU7AVAFbjUGjBae+QqfAa/hFa1M2jGI3PO997hOH8knOSmFPSdQsnekrHv96JZKEW
 XNnEW9r1TPYIAJFqsCSfUC1zDTulqFLCsTW302nvK+ZC38OnGy+3zws2LUAU5FuWCoXE
 F8rstHroVaQEW1heYVTIRDbARp9Yb+1ed7bwErbuAQWqf53aqhqShNKbzfGvZq2wTBcS
 azdw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684201752; x=1686793752;
 h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=vCURr7Mv2ZvRpvvZLV/hru8m0KteklJRIVmRynPxVng=;
 b=ZQi6zDRKxGsCwcsB8UhGQAcleBf2TDnABXFm7avPchit+I58T+ABtEtQ0eRoRL7xra
 OcgrO/C5Z+s4KwkwqZgKk/H4Xriz1Sn/9bmkHLr1St550x5a8gGaqEqDq7Pz+WiPkf7i
 R/d4CsOJWGKgOPUoSyJgJKOQZVDIYXTsgxmu+7Hex8OMK2tPeRSILBOnb0M7YjtmAt0C
 4GZcfq3SAKSD51EO6T3YOGdphGQ74eDXssKxsTzFkKUGJ0zSnsi0Eycou586VOSC5DFm
 EqLY8ybKVNb296jnKJ2q5mOAF1bgxTFi7LpKsqpGHB+ID815gXomzQ7nKJEd9UHX/T2z
 M0AQ==
X-Gm-Message-State: AC+VfDwhwiS26bcu4fKuk5R9zJwtsddiF/xxXpPDIinRMccvt4cBbUWu
 3JA6sgQxhUxS4MRlotiMprNguQOlaSKWc27IlAHccwlzwx6kog==
X-Google-Smtp-Source: ACHHUZ4ZDedB10r7zDvdgHy8dmC7SOqwzc1zrSEl4nfwsJHAThY+4MP9hCf9vnY5RMOULNo7b59P9wMX8hfg8h4J13M=
X-Received: by 2002:a05:6870:1987:b0:177:ad57:cb36 with SMTP id
 v7-20020a056870198700b00177ad57cb36mr16063960oam.27.1684201751869; Mon, 15
 May 2023 18:49:11 -0700 (PDT)
MIME-Version: 1.0
From: Liu Hui <liuhui1610@HIDDEN>
Date: Tue, 16 May 2023 09:49:00 +0800
Message-ID: <CAOQTW-O2F3x+0Yrs63B99_0B2W=Dw=SKjYt0Neo_AAQ0E+yWnw@HIDDEN>
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
To: "mail@HIDDEN" <mail@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 61283
Cc: 61283 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Hi,

> 1. Start emacs -Q
> 2. Evaluate the following two test commands in the scratch buffer:
>
> (defun good ()
>   (interactive)
>   (pp (all-completions "" (nth 2 (pcomplete-completions-at-point)))))
>
> (defun bad ()
>   (interactive)
>   (pp (all-completions "-" (nth 2 (pcomplete-completions-at-point)))))
>
> 3. Run shell or eshell
> 4. Enter `xargs --' in order to complete command line options via
> `pcomplete-from-help'.
> 5. M-x good -> Printed completion strings will have pcomplete-annotation
> and pcomplete-help text properties. These are used by the
> :annotation-function and the :company-docsig function.
> 6. M-x bad -> Returned completion strings are stripped of their text
> properties.
> 7. When triggering completion manually by pressing TAB, there are
> no annotations displayed in the *Completions* buffer.
>
> If I recall correctly, this functionality worked at some point and the
> text properties were not removed, such that annotations worked. The

I cannot find a working commit after a9941269683, which adds the two
text properties.

> culprit, which destroys the properties, seems to be
> `completion-table-with-quoting' in `pcomplete-completions-at-point', but
> I wasn't able to figure out which commit caused this (I did not do any
bisecting).

I agree that completion-table-with-quoting is responsible.
pcomplete-annotation and pcomplete-help text properties can be
successfully shown by the completion UI (corfu/company) by applying
the following patch:

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index a3dc1b0cfbf..b0c32b938a0 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -700,6 +700,7 @@ completion--twq-all
            ;;  (concat (substring ustring 0 boundary)
            ;;          completion))
            ;; t)
+                   (add-text-properties 0 1 (text-properties-at 0
completion) qcompletion)
                    qcompletion))
                completions)
        qboundary))))

It just re-adds text properties to completions produced by
`completion-table-with-quoting', but I'm not sure it is the proper
fix. What do you think?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Feb 2023 00:23:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 04 19:23:51 2023
Received: from localhost ([127.0.0.1]:43650 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pOSow-0002ej-Qi
	for submit <at> debbugs.gnu.org; Sat, 04 Feb 2023 19:23:51 -0500
Received: from lists.gnu.org ([209.51.188.17]:60388)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1pOSou-0002ea-Oo
 for submit <at> debbugs.gnu.org; Sat, 04 Feb 2023 19:23:49 -0500
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 <mail@HIDDEN>)
 id 1pOSou-0005Wu-7N
 for bug-gnu-emacs@HIDDEN; Sat, 04 Feb 2023 19:23:48 -0500
Received: from server.qxqx.de ([2a01:4f8:121:346::180] helo=mail.qxqx.de)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mail@HIDDEN>)
 id 1pOSop-0000z6-Rc
 for bug-gnu-emacs@HIDDEN; Sat, 04 Feb 2023 19:23:47 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:
 From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description
 :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=fp3LjWSbUe11o2hMdmuMoNijtgGXM80VbgEJ9EA3tAY=; b=kxLjpxL0NqYZ8eM5/KVlPzQOzo
 SuC10bkOQ8L78KaaTGgc6bYk8rWUkuBfOD8j7yDVC8545OhYKPpGqUQLgnrEAeupCAQePzym/N7IT
 iuUOB9WMumyh4Ggy5RrjY0GxnANVfwVnkK9OUGCTlg3QPiKikCjOaHYU0E2FaWhn9qUU=;
From: Daniel Mendler <mail@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.60; pcomplete-completions-at-point loses text properties,
 breaking pcomplete-from-help annotations
Date: Sun, 05 Feb 2023 01:23:35 +0100
Message-ID: <87cz6px8mw.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a01:4f8:121:346::180;
 envelope-from=mail@HIDDEN; helo=mail.qxqx.de
X-Spam_score_int: -41
X-Spam_score: -4.2
X-Spam_bar: ----
X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: gregory@HIDDEN, arstoffel@HIDDEN, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

1. Start emacs -Q
2. Evaluate the following two test commands in the scratch buffer:

(defun good ()
  (interactive)
  (pp (all-completions "" (nth 2 (pcomplete-completions-at-point)))))

(defun bad ()
  (interactive)
  (pp (all-completions "-" (nth 2 (pcomplete-completions-at-point)))))

3. Run shell or eshell
4. Enter `xargs --' in order to complete command line options via
`pcomplete-from-help'.
5. M-x good -> Printed completion strings will have pcomplete-annotation
and pcomplete-help text properties. These are used by the
:annotation-function and the :company-docsig function.
6. M-x bad -> Returned completion strings are stripped of their text
properties.
7. When triggering completion manually by pressing TAB, there are
no annotations displayed in the *Completions* buffer.

If I recall correctly, this functionality worked at some point and the
text properties were not removed, such that annotations worked. The
culprit, which destroys the properties, seems to be
`completion-table-with-quoting' in `pcomplete-completions-at-point', but
I wasn't able to figure out which commit caused this (I did not do any
bisecting).

In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw scroll bars) of 2023-01-26 built on projects
Repository revision: f8c95d1a7681e861fc22d2a040cda0ddfe23eff4
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)




Acknowledgement sent to Daniel Mendler <mail@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#61283; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 11 Sep 2023 15:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.