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: Thu, 19 Sep 2024 15:59:17 +0100 Message-ID: <877cb7sn96.fsf@ice9.digital> References: <875xqzicit.fsf@ice9.digital> <871q1m36jw.fsf@ice9.digital> <87o74q7ylr.fsf@ice9.digital> <87cyl04sof.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="5474"; 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 Thu Sep 19 17:01:05 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 1srIeW-0001DG-V3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Sep 2024 17:01:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srIeJ-0004F1-4R; Thu, 19 Sep 2024 11:00: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 1srIeE-0004Eh-1r for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2024 11:00:46 -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 1srIeD-0006f4-86 for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2024 11:00:45 -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=dQ4nKv5r9xu7DU29ZLscdFEF1/iT/OB4YSwUiedkE8I=; b=HsJZYLQ1MqGy4PkmK955lPGifK/iA0SKfKRJTdFITn4n5ffF/9cXkYBEMxptZLQQwUynaBtrUis3ew8AVmIVKVJVVtMhwLYUEOuTuNfZCtMYlePBSEM4vuXh1gKjErKS2inNXjM7tinPM3y2hMgugxW7k3CP6r5lI7ETjnQpgnWrHaga8MCDtsEDojx9SagMxCIFjOo/u0+RqCx6+H28l4XLqAsaVbVlfmPsuTQ3dgbYBKh52RxfqEd40+aaQcpD1e0ZmTpPJW8wmdecY4S3jtWoj+BAzMLDD/tohzpjQrgtTRxxNwmVT2L0FP7xdoNT/wbV923RLbZo5lKCD/6UVA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srIeU-0004Jx-Ea for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2024 11:01: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: Thu, 19 Sep 2024 15:01: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.172675800715959 (code B ref 73234); Thu, 19 Sep 2024 15:01:02 +0000 Original-Received: (at 73234) by debbugs.gnu.org; 19 Sep 2024 15:00:07 +0000 Original-Received: from localhost ([127.0.0.1]:33257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srIda-00049K-TB for submit@debbugs.gnu.org; Thu, 19 Sep 2024 11:00:07 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:44603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srIdY-00048I-2U for 73234@debbugs.gnu.org; Thu, 19 Sep 2024 11:00:05 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id E7C54E0003; Thu, 19 Sep 2024 14:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ice9.digital; s=gm1; t=1726757959; 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=dQ4nKv5r9xu7DU29ZLscdFEF1/iT/OB4YSwUiedkE8I=; b=iFXTeIqXcqe6QH/Z8ktBylkbHzyNQzS3i5+5Pikrgh1OUickIDsZB+CvfoPw5wJDllirSO wSST53ncsGQ8/MaRkpRGM8Zc7367SkNCUGnQS772R0cPAtJ36P6wmYsK41+tb7RX7IT94l DmzjMh1bT9erKEXqYopA6NXikPLUSO1cIT/R4pipva5UIMCdTAO1T/wGy7mi926RY1opL/ ARyUZTtm+1Zhvd9smsf0hB5+/2yVRr5JK+cVgQRYS8caWB0GPdRBpy4ziF30Xmf9i3rJzf BNE5Gd7Y/nME15YfCDvmQqR3zGwxJragqKoFtVXr4iEibMUscRwzyFSFJQEjRg== In-Reply-To: (Eshel Yaron's message of "Thu, 19 Sep 2024 07:39:57 +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:292058 Archived-At: Eshel Yaron writes: >> e.g. If a valid completion was "FooBar", and I typed "foo", having the >> final result as "fooBar" wouldn't be ideal. > > Fair enough, although earlier you mentioned that your use case was > completing symbols in a case-insensitive language, so I wonder what's > wrong with "fooBar", or "foobar" for that matter. They are all the same > as the completion candidate, "FooBar", ignoring case differences, no? The symbols would technically be valid in the language, but the completion candidates will be using a particular style of naming. Fundamentally, if I am meant to be writing using PascalCase then I don't want the result to be accidentally transformed into camelCase. >> 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 thought that completion-preview-active-mode-hook might have been suitable, but it looks like that is being called on every key-press when typing in the buffer (without the completion preview). Thanks, Morgan -- Morgan Willcock