GNU bug report logs - #43120
28.0.50; fido-mode: M-j before completions appear selects wrong choice

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Sun, 30 Aug 2020 21:01:01 UTC

Severity: normal

Tags: fixed

Merged with 43083

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 43120 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 43120 <at> debbugs.gnu.org, joaotavora <at> gmail.com
Subject: Re: bug#43120: 28.0.50; fido-mode: M-j before completions appear
 selects wrong choice
Date: Sat, 05 Sep 2020 14:25:51 +0200
Sean Whitton <spwhitton <at> spwhitton.name> writes:

> I think I see what the problem is.  I was doing the following to
> generate a test case: C-h f comp [wait for completions to appear] C-g

Oh, right; didn't think that through properly...

> This leaves completion-content-when-empty populated to interfere with
> the next run, as getting out of the minibuffer that way does not clear
> the variable, but it should.
>
> Might it work to set the variable buffer-local to the minibuffer?  Then
> we can be sure it would always be cleared.

All this time I thought the minibuffer was reused, but poking around a
bit now, it seems like it's not?

In which case -- does the following fix this problem?

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 8a68df876c..ba266cfbfe 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -715,7 +715,7 @@ icomplete-completions
 	(setq prospects (nreverse prospects))
         ;; Return the first match if the user hits enter.
         (when icomplete-show-matches-on-no-input
-          (setq completion-content-when-empty (car prospects)))
+          (setq-local completion-content-when-empty (car prospects)))
         ;; Decorate first of the prospects.
 	(when prospects
 	  (let ((first (copy-sequence (pop prospects))))


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 311 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.