From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#61283: 29.0.60; pcomplete-completions-at-point loses text properties, breaking pcomplete-from-help annotations Date: Wed, 17 May 2023 08:31:18 +0200 Message-ID: References: <2eb987c6-0aec-55df-db4e-ef95557ab809@daniel-mendler.de> <83zg64zhyx.fsf@gnu.org> <31f17ffe-8070-4259-03d2-2c63e5cc5ee9@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30597"; mail-complaints-to="usenet@ciao.gmane.io" Cc: liuhui1610@gmail.com, monnier@iro.umontreal.ca, 61283@debbugs.gnu.org To: Jim Porter , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 17 08:32:30 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzAi6-0007kG-Db for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 May 2023 08:32:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzAhn-0000sD-LY; Wed, 17 May 2023 02:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzAhe-0000rq-Ir for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 02:32:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pzAhe-0008QW-3x for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 02:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzAhd-0008PF-Sd for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 02:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 May 2023 06:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61283 X-GNU-PR-Package: emacs Original-Received: via spool by 61283-submit@debbugs.gnu.org id=B61283.168430508832275 (code B ref 61283); Wed, 17 May 2023 06:32:01 +0000 Original-Received: (at 61283) by debbugs.gnu.org; 17 May 2023 06:31:28 +0000 Original-Received: from localhost ([127.0.0.1]:48655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzAh6-0008OU-HX for submit@debbugs.gnu.org; Wed, 17 May 2023 02:31:28 -0400 Original-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 ) id 1pzAh4-0008OE-65 for 61283@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=; Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261825 Archived-At: 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