all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 62700@debbugs.gnu.org, juri@linkov.net
Subject: bug#62700: 29.0.60; minibuffer-{previous,next,choose}-completion behave unintuitively when point is not at end of buffer
Date: Thu, 06 Apr 2023 14:58:42 -0400	[thread overview]
Message-ID: <ierv8i8suql.fsf@janestreet.com> (raw)
In-Reply-To: <83r0swq39p.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 06 Apr 2023 21:22:42 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> Cc: Juri Linkov <juri@linkov.net>
>> From: Spencer Baugh <sbaugh@janestreet.com>
>> Date: Thu, 06 Apr 2023 13:56:35 -0400
>> 
>> 6. C-h v -path
>> 7. C-a to move point to before -path
>> 8. <tab> to show completions of variables ending in -path
>> 9. Use M-<up> and M-<down> to switch between completions.  Now as you
>> switch completions, they are inserted at point, *without* replacing the
>> text already in the buffer.  So e.g. the minibuffer will contain
>> "load-path-path".
>> 10. Likewise, if you (setq minibuffer-completion-auto-choose nil), M-RET
>> inserts the completion string at point, without replacing the text in
>> the minibuffer, so you will get "load-path-path".
>> 
>> I think this is basically just a bug.
>
> I think it's the intended behavior.  In this case, it looks not
> useful, because the string you typed before starting to use M-<UP> and
> M-<DOWN> happens to be at the end of each completion candidate.  But
> this is not the only situation possible.  Basically, completion always
> modifies only the text before point, leaving what's after point
> intact, so that the user could have after point stuff that completion
> should ignore, and that eventually will be appended to the selected
> candidate.

Could you give an example of when this would be desirable?

>> Hopefully we can fix this before Emacs 29 is released, because this
>> is the last thing which stops these new commands from being a really
>> great improvement to the Emacs completion defaults.
>
> Why did you need to move point to the beginning of what you typed to
> begin with?  Unless you explain that, I don't see how we can consider
> this issue important enough to fix at all, let alone for Emacs 29.
>
>> If this is intentional for some reason, I think the behavior should
>> definitely be changed before Emacs 29 is released.  Moving point around
>> in the minibuffer while completing is an important part of using the
>> default completion-styles
>
> It is? why?

"basic" and "emacs22" are default completion-styles, and they both treat
text after point differently from text before point.

For example, suppose I wanted to wanted to complete filenames starting
with x and ending in .c.  The way I would do this with the default
completion-styles is enter "x.c", placing point just before ".", and hit
TAB.  (I could equivalently do x*.c and hit TAB, but that will move
point to right after the "*" and run into this same issue!)

Actually, * is another good example.  If I input a * in my string to be
completed (which is provided by partial-completion, a default
completion-style), then when I hit TAB point is moved back to the site
of the *.  This makes * very hard to use at the same time as
minibuffer-{previous,next}-completion, because of their behavior of not
modifying the text after point.





  reply	other threads:[~2023-04-06 18:58 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 [this message]
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
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=ierv8i8suql.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=62700@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    /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.