all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: 62700@debbugs.gnu.org
Subject: bug#62700: 29.0.60; minibuffer-{previous,next,choose}-completion behave unintuitively when point is not at end of buffer
Date: Fri, 07 Apr 2023 19:37:51 +0300	[thread overview]
Message-ID: <86h6tr4pi8.fsf@mail.linkov.net> (raw)
In-Reply-To: <iersfdcstme.fsf@janestreet.com> (Spencer Baugh's message of "Thu, 06 Apr 2023 15:22:49 -0400")

>> I agree that it would be nice to fix this in Emacs 29.
>> But the problem is that this would require non-trivial changes.
>> We need to apply a small part of the patch mentioned in
>> bug#47711, bug#48356, bug#48841, bug#60313 and located at
>> https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00412.html
>> that implements the following FIXME item in 'completion-all-completions':
>
> Any updates on the status of this patch?  I see you asked the same thing
> a year ago in one of those bugs.

A year ago I had a clear understanding how to do this but unfortunately
now forgot the details.  The idea was to return from completion-all-completions
not only '("string" . number) where number is the start of the completion position,
but something like '("string" . (number1 number2)) where the second number is
the end of the completion position.

completion-all-completions is called from minibuffer-completion-help.
Then the second number could help to set the right base-suffix in

  (setq-local completion-base-affixes
              (list base-prefix base-suffix))

This base-suffix is used later by M-<up> and M-<down>.
When here base-suffix is "", then your test case will be fixed.
However, non-empty base-suffix is necessary in other cases
such as mentioned in bug#48356:

  ~/emacs/master/li|/calc

> I can try to prepare a more minimal version of this patch, just targeted
> at adding the ability to return the end of the completion position.
>
> Do you have any advice on an appropriate API for that?  An alist as in
> that patch seems reasonable to me, but perhaps there's an even simpler
> approach?

Changing the API will definitely cause problems with backwards-compatibility.
But maybe you could find a simple heuristic that would decide what base-suffix
to set in minibuffer-completion-help?  Then no API changes will be needed.





  reply	other threads:[~2023-04-07 16:37 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06 17:56 bug#62700: 29.0.60; minibuffer-{previous,next,choose}-completion behave unintuitively when point is not at end of buffer Spencer Baugh
2023-04-06 18:22 ` Eli Zaretskii
2023-04-06 18:58   ` Spencer Baugh
2023-04-06 19:30     ` Eli Zaretskii
2023-04-06 20:42       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-06 18:55 ` Juri Linkov
2023-04-06 19:22   ` Spencer Baugh
2023-04-07 16:37     ` Juri Linkov [this message]
2023-04-07 21:02       ` sbaugh
2023-04-08  6:34         ` Eli Zaretskii
2023-04-08 10:58           ` sbaugh
2023-04-08 13:19             ` Eli Zaretskii
2023-04-08 18:36           ` Juri Linkov
2023-04-08 19:32             ` Eli Zaretskii
2023-04-09 16:40               ` Juri Linkov
2023-04-09 17:38                 ` Eli Zaretskii
2023-04-08 18:30         ` Juri Linkov
     [not found]   ` <ierbk6lup79.fsf@janestreet.com>
2024-04-07 17:16     ` Juri Linkov
     [not found] <b921ea5c-71a2-4e8f-b1cf-dd26831f8104@email.android.com>
2023-04-10 18:20 ` Juri Linkov
2023-04-20 16:52   ` Spencer Baugh
2023-04-20 18:18     ` Juri Linkov
2023-04-20 18:46       ` Spencer Baugh
2023-04-20 19:00         ` Eli Zaretskii
2023-04-21 18:56           ` sbaugh
2023-04-22 10:48             ` Eli Zaretskii
2023-04-22 12:57               ` sbaugh
2023-04-22 13:15                 ` Eli Zaretskii
2023-04-22 21:38                   ` sbaugh
2023-04-23  6:13                     ` Eli Zaretskii
2023-04-23 11:48                       ` sbaugh
2023-04-24 11:22                         ` Eli Zaretskii
2023-05-02 15:13               ` sbaugh
2023-05-02 17:57                 ` Eli Zaretskii
2023-05-08 15:48                   ` Juri Linkov
2023-05-08 16:11                     ` Eli Zaretskii
2023-06-03  0:58                       ` Spencer Baugh
2023-06-04  7:09                         ` Eli Zaretskii
2023-06-10 10:51                       ` Eli Zaretskii
2023-06-12 18:27                         ` Juri Linkov
2023-06-13  2:32                           ` Eli Zaretskii
2023-06-13 16:54                             ` Juri Linkov
2023-06-13 16:59                               ` Eli Zaretskii
2023-06-13 20:59                                 ` Spencer Baugh
2023-06-14 17:32                                   ` Juri Linkov
2023-09-03 17:37                                   ` Juri Linkov
2023-09-04  0:30                                     ` sbaugh
2023-09-04  6:51                                       ` Juri Linkov
2023-11-14  7:39                                     ` Juri Linkov
2023-11-15 17:42                                       ` Juri Linkov
2023-04-20 18:51       ` 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=86h6tr4pi8.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=62700@debbugs.gnu.org \
    --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.