all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: 70217@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#70217: [PATCH] Add substring-partial-completion style
Date: Sun, 26 May 2024 12:11:11 +0300	[thread overview]
Message-ID: <86ttilvsy8.fsf@gnu.org> (raw)
In-Reply-To: <ierbk4t7fjt.fsf@janestreet.com> (message from Spencer Baugh on Sat, 25 May 2024 17:22:14 -0400)

> From: Spencer Baugh <sbaugh@janestreet.com>
> Cc: 70217@debbugs.gnu.org,  monnier@iro.umontreal.ca
> Date: Sat, 25 May 2024 17:22:14 -0400
> 
> > This is a user option, so the doc string should be understandable by
> > users, not just by Lisp programmers who tinker with completion stuff.
> 
> OK, reworded that docstring heavily.  Maybe it's better now?

See below.

> > Also, this new option should be in NEWS, I think.
> 
> Added to NEWS and documentation, and the same for the new possible
> values of completion-styles.

Thanks.

> ++++
> +*** 'completion-styles' now can contain lists of bindings
                                                            ^
A period is missing there

> +An element of 'completion-styles' can be a symbol naming a completion
> +style in 'completion-styles-alist'.  Now it can also be a list of the

This is better rephrased like this:

  In addition to being a symbol naming a completion style, an element
  of 'completion-styles' can now be a list of the form...

> +form '(style ((variable value) ...))' where style is a symbol naming a

We usually up-case the meta-syntactic variables in these cases, so

   (STYLE ((VARIABLE VALUE) ...)

> +completion style.  'variable' will be bound to 'value' (without

Up-case "variable" and "value", and don't quote them.

> +evaluating it) while the style is executing.  This allows duplicating a
> +completion style with different values for completion-affecting

Not "duplicating" (which sounds negative), but something like
"multiple references to the same style".

> +An element can also be a list of the form \"(style ((variable value)
> +...))\".  \"style\" must be a symbol listed in
> +`completion-styles-alist', followed by a `let'-style list of
> +variable/value pairs.  \"variable\" will be bound to \"value\" (without
> +evaluating it) while the style is handling completion.  This allows
> +repeating the same style with different configurations.

Here, too, up-case STYLE, VARIABLE, and VALUE, and don't quote them,
since they are not literal symbols, they are "placeholders" --
references to something else.

> +(defcustom completion-pcm-anchored t
> +  "If non-nil, PCM matches only against the start of completions.

What is a "PCM"?  And what are "completions"?  I'm guessing you meant
something like

  If non-nil, completion candidates must match at beginning of completed string.

> +For example: when the string being completed is \"b/c\",
> +\"bbb/ccc\" is a valid completion according to
> +partial-completion.  If this is nil, then \"aaa/bbb/ccc\" and
> +\"aaabbb/ccc\" are also valid completions."

Isn't this not the best example?  "b/c" does NOT match "bbb/ccc" at
the beginning.  Or what am I missing?

Thanks.





  parent reply	other threads:[~2024-05-26  9:11 UTC|newest]

Thread overview: 31+ 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
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 [this message]
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
2024-08-08 13:13                                         ` Spencer Baugh
2024-08-10  8:02                                           ` Eli Zaretskii
2024-08-21 16:01                                             ` Spencer Baugh
2024-08-21 16:16                                               ` Spencer Baugh
2024-08-24  9:23                                                 ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=86ttilvsy8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70217@debbugs.gnu.org \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.