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: "Géza Herman" <geza.herman@gmail.com>
Cc: 67514@debbugs.gnu.org
Subject: bug#67514: 30.0.50; completion preview symbol length calculation should use point
Date: Tue, 28 Nov 2023 22:46:32 +0100	[thread overview]
Message-ID: <m1jzq17dqf.fsf@dazzs-mbp.home> (raw)
In-Reply-To: <87y1ehfw8a.fsf@gmail.com> (Herman@debbugs.gnu.org's message of "Tue, 28 Nov 2023 21:39:49 +0100")

Géza Herman <geza.herman@gmail.com> writes:

> I checked out completion-preview, and so far I like it.

Great.

> There is a thing which maybe can be improved (so this is not a bug
> report, just a suggestion): it's how
> completion-preview-require-minimum-symbol-length calculates the
> length.  Currently it just returns the length of the symbol under the
> cursor.  I think it would be better to use the length of the part that
> actually will be used for completion, because if the point is inside a
> word, then it should only consider the part between the symbol start
> end the point.

Could you please explain why you consider that preferable?  The current
behavior is intentional and, unless I'm missing something, correct.
`completion-at-point-functions` take into account text that follows
point as well as the text that precedes point, and Completion Preview
mode works also when you're typing in the middle of a symbol.  For
example, consider the following text in an Elisp buffer:

--8<---------------cut here---------------start------------->8---
(minor
--8<---------------cut here---------------end--------------->8---

With point between the opening parenthesis and the letter "m", type
"define-".  The completion preview displays "-mode" just after "minor",
suggesting that you complete to "define-minor-mode".  That's because the
text after point ("minor", in this case) plays a role too.


Best,

Eshel





  reply	other threads:[~2023-11-28 21:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 20:39 bug#67514: 30.0.50; completion preview symbol length calculation should use point Herman, Géza
2023-11-28 21:46 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-11-28 23:17   ` Herman, Géza
2023-11-29  8:55     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-29  9:06       ` Herman, Géza
2023-11-29 21:26         ` 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=m1jzq17dqf.fsf@dazzs-mbp.home \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67514@debbugs.gnu.org \
    --cc=geza.herman@gmail.com \
    --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).