unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Morgan Willcock <morgan@ice9.digital>
To: Eshel Yaron <me@eshelyaron.com>
Cc: 73234@debbugs.gnu.org
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	[thread overview]
Message-ID: <877cb7sn96.fsf@ice9.digital> (raw)
In-Reply-To: <m11q1g8amq.fsf@dazzs-mbp.home> (Eshel Yaron's message of "Thu, 19 Sep 2024 07:39:57 +0200")

Eshel Yaron <me@eshelyaron.com> 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





  reply	other threads:[~2024-09-19 14:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13 19:23 bug#73234: 30.0.91; completion-preview-mode doesn't trigger for case-insensitive capf Morgan Willcock
2024-09-14  6:07 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-14  9:53   ` Morgan Willcock
2024-09-14 16:23     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-14 20:46       ` Morgan Willcock
2024-09-15  6:40         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-17 19:03           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-18 20:23             ` Morgan Willcock
2024-09-19  5:39               ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-19 14:59                 ` Morgan Willcock [this message]
2024-09-20  9:27                   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-20 10:05                     ` Morgan Willcock
2024-09-20 10:34                       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cb7sn96.fsf@ice9.digital \
    --to=morgan@ice9.digital \
    --cc=73234@debbugs.gnu.org \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).