GNU bug report logs - #73234
30.0.91; completion-preview-mode doesn't trigger for case-insensitive capf

Previous Next

Package: emacs;

Reported by: Morgan Willcock <morgan <at> ice9.digital>

Date: Fri, 13 Sep 2024 19:24:02 UTC

Severity: normal

Found in version 30.0.91

Full log


Message #29 received at 73234 <at> debbugs.gnu.org (full text, mbox):

From: Eshel Yaron <me <at> eshelyaron.com>
To: Morgan Willcock <morgan <at> ice9.digital>
Cc: 73234 <at> debbugs.gnu.org
Subject: Re: bug#73234: 30.0.91; completion-preview-mode doesn't trigger for
 case-insensitive capf
Date: Thu, 19 Sep 2024 07:39:57 +0200
Hi,

Morgan Willcock <morgan <at> ice9.digital> writes:

> Eshel Yaron <me <at> eshelyaron.com> writes:
>
>> FYI, I've added a new user option completion-preview-ignore-case on the
>> master branch (commit f1794a17b62), which controls case sensitivity for
>> Completion Preview mode specifically.  This is definitely safe to set
>> buffer-locally.  The docstring of this new variable should hopefully
>> also explain exactly what's the expected behavior in this regard.
>
> Thanks for adding the new option.  For my use case I don't think I would
> be able to use it because the case mismatch between the text already
> typed and the completion will effectively be generating a completion
> which may not actually exist.
>
> 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?

> 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.
That's an interesting solution, I think.  Or do you have some other kind
of hook in mind?


Best,

Eshel




This bug report was last modified 270 days ago.

Previous Next


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