all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Ergus <spacibba@aol.com>, "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Cc: "me@eshelyaron.com" <me@eshelyaron.com>
Subject: RE: [External] : [PATCH] Completion preview common
Date: Sun, 7 Apr 2024 21:15:32 +0000	[thread overview]
Message-ID: <SJ0PR10MB548860C9D0B0BE399727B779F3012@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <njlevizac6zitj5fulduqcgtfwhac5vmcsz2we562fym7z5u6i@su5oafrms4r7>

> The goal is to preview a common prefix
> when available and longer than the prefix
> already inserted.

Related perhaps:

https://www.emacswiki.org/emacs/Icicles_-_Expanded-Common-Match_Completion

The "expanded common match" described there
is the "longest match of your input pattern
that is common to all candidates and also
contains the first input match in the first
or second candidate, whichever is longer".

This notion and behavior apply to not only
prefix completion but also regexp completion
(and substring completion).

This kind of common-match expansion is quick
but it doesn't always find the longest match.
(And of course there can be more than one
longest common match.)

The expansion typically does find a longest
common match, however, because your input
typically matches the first or the second
candidate in only one place.

And the longer the input you type, the more
likely this is.  In practice, it's only with
very short input such as 'a' that expansion
sometimes misses a longest common match.

The algorithm tries two candidates (1st and
2nd) as its starting point, to increase the
probability of finding a longest common match.

The expanded common match isn't just a common
substring among all of the candidates matched
by your input pattern.  It's a substring
common to all candidates matched by your input,
but a substring that also matches your input.

For example, with regexp completion input
`a.z' and candidates 'abz' and 'apz', there's
no expanded common match.  The substring 'a'
is common to both candidates, but it's not
matched by the (complete) input pattern.




      parent reply	other threads:[~2024-04-07 21:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <njlevizac6zitj5fulduqcgtfwhac5vmcsz2we562fym7z5u6i.ref@su5oafrms4r7>
2024-04-07 18:38 ` [PATCH] Completion preview common Ergus
2024-04-07 21:12   ` Eshel Yaron
2024-04-07 23:39     ` Ergus
2024-04-09 18:30       ` Eshel Yaron
2024-04-09 23:05         ` Ergus
2024-04-10 11:55           ` Eshel Yaron
2024-04-10 15:54             ` Ergus
2024-04-12  6:18               ` Eshel Yaron
2024-04-07 21:15   ` Drew Adams [this message]

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=SJ0PR10MB548860C9D0B0BE399727B779F3012@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=me@eshelyaron.com \
    --cc=spacibba@aol.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.