[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#61535: 29.0.60; choose-completion erases in-region buffer
From: |
Eli Zaretskii |
Subject: |
bug#61535: 29.0.60; choose-completion erases in-region buffer |
Date: |
Sat, 18 Feb 2023 21:30:37 +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?
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Juri Linkov, 2023/02/15
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Eli Zaretskii, 2023/02/15
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Juri Linkov, 2023/02/16
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Eli Zaretskii, 2023/02/16
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Juri Linkov, 2023/02/17
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Eli Zaretskii, 2023/02/17
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Juri Linkov, 2023/02/18
- bug#61535: 29.0.60; choose-completion erases in-region buffer,
Eli Zaretskii <=
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Juri Linkov, 2023/02/19
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Eli Zaretskii, 2023/02/19
- bug#61535: 29.0.60; choose-completion erases in-region buffer, Juri Linkov, 2023/02/19