all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 61535@debbugs.gnu.org
Subject: bug#61535: 29.0.60; choose-completion erases in-region buffer
Date: Sat, 18 Feb 2023 21:30:37 +0200	[thread overview]
Message-ID: <83r0umydnm.fsf@gnu.org> (raw)
In-Reply-To: <86h6vilsqe.fsf@mail.linkov.net> (message from Juri Linkov on Sat, 18 Feb 2023 20:43:21 +0200)

> From: Juri Linkov <juri@linkov.net>
> Cc: 61535@debbugs.gnu.org
> Date: Sat, 18 Feb 2023 20:43:21 +0200
> 
> >> >> >> 1. type: (with-c C-M-i
> >> >> >> 2. type: M-down ... M-RET
> >>
> >> Actually, this is not an old problem.  It's in a new feature added in 29.1.
> >
> > Hmmm... I don't think I see that.  Both completion-in-region-mode and
> > the condition at that place haven't changed in a while.  The addition
> > of completion-use-base-affixes part is new, but since it's via 'and',
> > it cannot have changed what the code before did, only cause it to do
> > that in fewer cases.  What am I missing?
> 
> 'M-RET' above is new.  It's bound to the new function
> 'minibuffer-choose-completion' that let-binds
> 'completion-use-base-affixes' to t that works
> only in the minibuffer, not in 'completion-in-region-mode'.
> 
> >> And this patch fixes the new feature.  This is different from a similar
> >> problem fixed now in bug#61479 that is really an old problem.
> >
> > This is all undecipherable for me, sorry.  What is that "new feature",
> > and how is it fixed here?
> 
> New feature is 'M-RET', 'minibuffer-choose-completion',
> 'completion-use-base-affixes'.  What is fixed here
> is their interaction.

Sorry, I'm still confused.  The patch you want to install is

diff --git a/lisp/simple.el b/lisp/simple.el
index c58acfe3adc..1924567cc3f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -9882,7 +9882,8 @@ choose-completion
       (with-current-buffer buffer
         (choose-completion-string
          choice buffer
-         (or (and completion-use-base-affixes base-affixes)
+         (or (and (not completion-in-region-mode)
+                  completion-use-base-affixes base-affixes)
              base-position
              ;; If all else fails, just guess.
              (list (choose-completion-guess-base-position choice)))

But by default, completion-in-region-mode is t and
completion-use-base-affixes is nil.  So this code is never executed in
the recipe you posted, right?

Moreover, if I look at buffer-undo-list, I don't think I see there
that the entire buffer text of *scratch* was deleted and recreated.

So what am I missing, and what is the problem you are trying to fix?





  reply	other threads:[~2023-02-18 19:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 18:32 bug#61535: 29.0.60; choose-completion erases in-region buffer Juri Linkov
2023-02-15 19:35 ` Eli Zaretskii
2023-02-16 17:51   ` Juri Linkov
2023-02-16 20:09     ` Eli Zaretskii
2023-02-17  7:50       ` Juri Linkov
2023-02-17  8:37         ` Eli Zaretskii
2023-02-18 18:43           ` Juri Linkov
2023-02-18 19:30             ` Eli Zaretskii [this message]
2023-02-19 17:31               ` Juri Linkov
2023-02-19 18:35                 ` Eli Zaretskii
2023-02-19 19:32                   ` Juri Linkov

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=83r0umydnm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=61535@debbugs.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.