From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73234: 30.0.91; completion-preview-mode doesn't trigger for case-insensitive capf Date: Sat, 14 Sep 2024 08:07:58 +0200 Message-ID: References: <875xqzicit.fsf@ice9.digital> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37269"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73234@debbugs.gnu.org To: Morgan Willcock Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 14 08:09:13 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 1spLy4-0009Wu-BE for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Sep 2024 08:09:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spLxo-00071z-Da; Sat, 14 Sep 2024 02:08:56 -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 1spLxk-00071j-SU for bug-gnu-emacs@gnu.org; Sat, 14 Sep 2024 02:08:54 -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 1spLxj-0000Xp-Ul for bug-gnu-emacs@gnu.org; Sat, 14 Sep 2024 02:08:52 -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=NG74kI4K3dOthM/R1L2qF9w/5D2BzP145GzuDdjNTp4=; b=IMAxm+a4ELVNeQpXMu+6jmCisoRe4jDn0P6cTeXjrBxEryhWlkc4NRWgSffQKzjaRbEhiVGmwlkE/jbUuZqU7RZAhAXUGhaMAgS9GvQrrlRR7clP3vUCkIvXb7VG8I6ZT2hI3grYSn5on/DKUUKFCDi3GmC/1vgPGw0oK8iwgsMG2YMSfGFcP9b0Hkkt88vcyOx3IZLlrptLJVPWhD+zIdbyuP5wUx3FOZ+5tfWaqTrtcoLGQcjIUCWnmrC76Pps9YGhzKz/Mjj+6FOyan9eN4b+TXJOPCOrxcpM3Jpx3Lf04M3rN0EgY3tnyRpdOOB+WHOifEgmEcV9gCdaX5zw4g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1spLxt-0006DY-Pw for bug-gnu-emacs@gnu.org; Sat, 14 Sep 2024 02:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Sep 2024 06:09:01 +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.172629409423832 (code B ref 73234); Sat, 14 Sep 2024 06:09:01 +0000 Original-Received: (at 73234) by debbugs.gnu.org; 14 Sep 2024 06:08:14 +0000 Original-Received: from localhost ([127.0.0.1]:44540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spLx8-0006CK-6t for submit@debbugs.gnu.org; Sat, 14 Sep 2024 02:08:14 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:56014 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spLx6-0006CC-7m for 73234@debbugs.gnu.org; Sat, 14 Sep 2024 02:08:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1726294081; bh=ZbJUY4JjGmZA7SLvq62jDbg73XcO+WP5jQcptr/2bJA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MmeZ6Vlc9Df3AdZ+OxFacct5oCkCIz3Z2+VbRUDZYZEdd6p85sbZ99M0RyAiXVUas fFIBud+Icvr5r0IQ5RvWqyO+RSoTnqy09Yq5tQz9qmH+2Zq9ZHAbxmo42C3QZ8dghc gLI0iJetU0tDWWtGObyjgO31QShsXMratsWbSpcjCaTpRX8jQ8FXz4fE9OSjo/1znJ cXK6rNIRSzUatwIFtQAZbXg2AkzeVMOZYNQ7MdONhiVSCI1irTRZb8lvtswg1noAnR dCZCIAsYXbDVQa4SGXL2lZLQzGjOfnY9wgZD8dpckexPB9t/3QDDtF18N2uhf3/ium /9QDJjsOyGFIQ== In-Reply-To: <875xqzicit.fsf@ice9.digital> (Morgan Willcock's message of "Fri, 13 Sep 2024 20:23:06 +0100") X-Hashcash: 1:20:240914:73234@debbugs.gnu.org::irau31RTlPE7UdfU:KCk X-Hashcash: 1:20:240914:morgan@ice9.digital::tG1B6nCuklc68mNS:EJkl 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:291681 Archived-At: Hello Morgan, Morgan Willcock writes: > I believe there is an issue with completion-preview-mode in that it > doesn't seem to find all completions for a case-insensitive completion > at point function. Thanks for this report. > Evaluating the code below in `emacs -Q` will put the current buffer into > fundamental mode with a case-insensitive completion at point function: > > (defun test-completion-at-point-function () > "Complete the symbol at point." > (pcase (bounds-of-thing-at-point 'symbol) > (`(,beg . ,end) > (list beg end > (completion-table-case-fold > (completion-table-dynamic > (lambda (string) > (list "TestSymbol")))))))) > > (fundamental-mode) > (remove-hook 'completion-at-point-functions #'tags-completion-at-point-function) > (add-hook 'completion-at-point-functions #'test-completion-at-point-function) > (completion-preview-mode 1) > > Once the code is evaluated: > > - Typing "tes" into the buffer will not display the completion preview. > > - The default completion mechanism (as initiated with complete-symbol > via C-M-i) will work with no problems, and replace "tes" with the > completion "TestSymbol". > > - Typing "Tes" into the buffer will display the completion preview. > > I would expect that the completion preview should be displayed for both > "tes" and "Tes" since a completion is available to use in both cases. We could display the completion preview also when you type a prefix that differs from a candidate prefix only in case (and in fact we already do, when completion-ignore-case is non-nil), but the question is what to do when you accept/insert this completion. Namely, changing the prefix from "tes" to "Tes" when you accept the completion suggestion adds complications both in terms of implementation and in terms of UX, and I'm not sure that this added complexity would be justified. Do you have, or know of, a concrete use case with a completion table that behaves like your test-completion-at-point-function? Best, Eshel