From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Morgan Willcock Newsgroups: gmane.emacs.bugs Subject: bug#73234: 30.0.91; completion-preview-mode doesn't trigger for case-insensitive capf Date: Fri, 20 Sep 2024 11:05:40 +0100 Message-ID: <87ttead4i3.fsf@ice9.digital> References: <875xqzicit.fsf@ice9.digital> <871q1m36jw.fsf@ice9.digital> <87o74q7ylr.fsf@ice9.digital> <87cyl04sof.fsf@ice9.digital> <877cb7sn96.fsf@ice9.digital> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31885"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73234@debbugs.gnu.org To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 20 12:07:27 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sraXu-00087T-6T for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Sep 2024 12:07:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sraXL-0003e0-2e; Fri, 20 Sep 2024 06:06:51 -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 1sraXE-0003Ur-Dg for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 06:06:45 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sraXD-0002Ka-I1 for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 06:06:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=3DsRobEnHOYOia2IkUatRGmi8hbPbTwBZ19v4eM2Whk=; b=KZKP5eCie4AXULaLGpa2tl/9rMvzEr0EroASshjEQ8Vhzzl0QsCtQ6BxMfoq2b5tYFsZUV45do6VTBXbZh9g7I9qYUgOHY2mFjwibyTyWzlj271HMV3zNiwpNWCYKYiO1PEz7psEEUcKms6IT272il3shNz/NztfCkhwQMn4RXaovRpeYTRxh+MyOLin0Cvl8ehnf/sVpaSrzasL2j1xQhqgHfgv4GZYueLWKQaBnaEyJf+5kE/+gl2m238/zbv+o3ZgE/GkxhsAVWiC/WVjHDR5by6YThs9eFiuD79JgD1Ym/aLqQuybj/T684zfMOAGoS0pHEJGDnkkL9Y1s4qrg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sraXW-00085m-4O for bug-gnu-emacs@gnu.org; Fri, 20 Sep 2024 06:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Morgan Willcock Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Sep 2024 10:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73234 X-GNU-PR-Package: emacs Original-Received: via spool by 73234-submit@debbugs.gnu.org id=B73234.172682679331058 (code B ref 73234); Fri, 20 Sep 2024 10:07:02 +0000 Original-Received: (at 73234) by debbugs.gnu.org; 20 Sep 2024 10:06:33 +0000 Original-Received: from localhost ([127.0.0.1]:34110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sraX3-00084s-0T for submit@debbugs.gnu.org; Fri, 20 Sep 2024 06:06:33 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:39057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sraWx-00084W-3I for 73234@debbugs.gnu.org; Fri, 20 Sep 2024 06:06:31 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 8C38E24000D; Fri, 20 Sep 2024 10:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ice9.digital; s=gm1; t=1726826741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3DsRobEnHOYOia2IkUatRGmi8hbPbTwBZ19v4eM2Whk=; b=BH81zPHrRJ+EsaNZzKuc+EpDEA0tEc2RXFVVhVBKCYC3vxCWn3Hm7NUyJ/MKO5H+ogvGsj edHK169yhCExhTUW/BuYv4RPyvNE0KzM/2bwYwxGCemAJ3GMqsHLiRBiyyWbMSWXS6cSZq tqBBs7idEKycKww69CB0LP9lojkdqH436txQRTQWsBC1jLqQztBO+GkcGjuSHnWLs2sqFQ R6m5PzsW4TIVK2tJadSXNjl75R4hQSD6H7evVOAvAARGU19n9aBvqObK9u4wr5bZWRsF5z aCMokRIIP2qS0E2j635ZLWrbsePSzyBKSEeo7WOZ156tY2FiOsEhaZbN+yxVqg== In-Reply-To: (Eshel Yaron's message of "Fri, 20 Sep 2024 11:27:19 +0200") X-GND-Sasl: morgan@ice9.digital 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:292100 Archived-At: Eshel Yaron writes: >>>> I've been trying to think of a way to get it to work without disturbing >>>> the user interface that already exists. Maybe it would be possible >>>> fixup the result in a post-insertion hook if one existed - such a hook >>>> might be generally useful anyway. >>> >>> We have the :exit-function (which your capf can provide as an extra >>> property alongside the completion table it returns), and indeed you >>> could use that to "fix" the case of your prefix after completing it. >> >> I don't think it is the responsibility of the completion function >> because it is not the completion function that is modifying the buffer. >>> >>> That's an interesting solution, I think. Or do you have some other kind >>> of hook in mind? >> >> Just a hook that runs after it was completion-preview-mode that inserted >> a completion. > > I'm quite not sure what you mean by responsibility, but in terms of > functionality, :exit-function is the existing interface for doing > something after a completion is inserted, and Completion Preview mode > supports this interface. The hook would be interface specific because it is the interface which has modified the case of the completion. > If :exit-function doesn't work for your use case, please explain why, > and if there's indeed a need for another hook, it's easy to add one :) My reasons for not using :exit-function would be: - If the completion was inserted using a different interface then the function would be running unnecessarily. - For completion functions that I didn't write, :exit-function isn't going to be set with the expectation that a particular completion interface and case preference is used to insert the candidate. That said, I am just trying to think of an easy mechanism to preserve the case of the candidate. A hook may generally be useful, but adding a hook does not solve the underlying problem that I am describing here. Perhaps it is best to just pause for the moment while you get additional feedback from other users. Thanks, Morgan -- Morgan Willcock