unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 70217@debbugs.gnu.org
Cc: sbaugh@janestreet.com, monnier@iro.umontreal.ca, drew.adams@oracle.com
Subject: bug#70217: [PATCH] Add substring-partial-completion style
Date: Sat, 06 Apr 2024 10:10:40 +0200	[thread overview]
Message-ID: <m1o7amap33.fsf@dazzs-mbp.kpn> (raw)
In-Reply-To: <SJ0PR10MB5488B00744F472A5B1D1BD6CF3032@SJ0PR10MB5488.namprd10.prod.outlook.com> (Drew Adams via's message of "Fri, 5 Apr 2024 19:46:07 +0000")

Drew Adams writes:

>> > It's preferable for this to be a separate style from partial-completion
>> > rather than a customization for partial-completion, because completing
>> > with a leading glob is inefficient: it doesn't allow the completion
>> > table to do any filtering at all.  So, for example, one might want the
>> > regular partial-completion style to run first, and if it doesn't find
>> > anything then the substring-partial-completion style can run.
>>
>> FWIW, I think the "language of completion styles"
>> would benefit from being a bit richer.
>
> FWIW, I agree.  Richer in different ways/dimensions.
>
>> I.e. instead of a completion style (i.e. an entry
>> in `completion-styles`) being limited to a symbol,
>> we could extend it so a style can take arguments.

One thing to keep in mind is that such parameterized completion styles
would make user interaction with completion styles more complicated.
It's much easier to indicate the effective completion style to the user,
and to allow them to pick and choose their completion styles on the fly,
when these completion styles are mere symbols.  (Currently Emacs doesn't
provide such UI for completion styles, but I proposed something along
these lines in branch feature/minibuffer-completion-enhancements.)

>>
>> E.g. the `substring` style could take an argument
>> which when set to the symbol `pcm` would cause it
>> to behave like your "substring-partial-completion":
>> (setq completion-styles '(basic (substring pcm) emacs22))
>>
>> Alternatively, it could be an argument to `partial-completion`, e.g.:
>> (setq completion-styles '(basic (partial-completion notanchored) emacs22))

[...]

> ...you have no way of knowing which style was
> actually used to produce a given set of candidates.
> For users, the link (cognitive and otherwise) is
> lost between a style and its completions for a
> given input pattern.

+1

I agree it's quite important to indicate which completion style produced
what you're seeing, at the very least such indication makes it clear
where you should look if you don't like the completions you got.


Best,

Eshel





  reply	other threads:[~2024-04-06  8:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 12:41 bug#70217: [PATCH] Add substring-partial-completion style Spencer Baugh
2024-04-05 18:35 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-05 19:46   ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-06  8:10     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-04-18 15:19   ` Spencer Baugh
2024-05-08 16:46     ` Spencer Baugh
2024-05-08 17:14       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-16 20:26         ` Spencer Baugh
2024-05-16 22:09           ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-17  6:23           ` Eli Zaretskii
2024-05-25 21:22             ` Spencer Baugh
2024-05-26  7:56               ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-26 12:49                 ` Spencer Baugh
2024-05-26  9:11               ` Eli Zaretskii
2024-05-26 13:02                 ` Spencer Baugh
2024-05-26 15:51                   ` Eli Zaretskii
2024-05-28 14:39                     ` Spencer Baugh
2024-05-28 15:11                       ` Eli Zaretskii
2024-05-28 18:16                         ` Spencer Baugh
2024-05-28 18:36                           ` Eli Zaretskii
2024-05-28 18:51                             ` Spencer Baugh
2024-05-28 19:21                               ` Eli Zaretskii
2024-05-28 20:01                                 ` Spencer Baugh
2024-06-01 14:20                                   ` Eli Zaretskii
2024-06-02 12:16                                     ` Spencer Baugh
2024-06-02 14:34                                       ` Stefan Monnier 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=m1o7amap33.fsf@dazzs-mbp.kpn \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70217@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=me@eshelyaron.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=sbaugh@janestreet.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).