GNU bug report logs - #19031
24.4; find-file in icomplete-mode shows completions with no input

Previous Next

Package: emacs;

Reported by: Ole Laursen <olau <at> iola.dk>

Date: Wed, 12 Nov 2014 16:42:02 UTC

Severity: normal

Tags: fixed

Found in version 24.4

Fixed in version 28.1

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

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Ole Laursen <olau <at> iola.dk>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 19031 <at> debbugs.gnu.org,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#19031: 24.4; find-file in icomplete-mode shows completions
 with no input
Date: Tue, 08 Dec 2020 10:51:04 +0200
> I originally reported this because I found it jarring to get a bunch
> of completions without having entered anything. In my home dir it
> basically shows me garbage (dot files that I'm never interested in).
>
> Would it not be possible to make a difference between the case where
> find-file provides some default text (current dir) and where I have
> entered some input? The variable literally says -on-no-input.

I tried to handle this case with the following patch, but it doesn't work
because read-file-name-default resets `minibuffer-default' to nil,
so icomplete doesn't know what was initial input in the minibuffer.

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 676917b9da..47bd8f90a4 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -579,7 +579,10 @@ icomplete-exhibit
         (goto-char (point-max))
                                         ; Insert the match-status information:
         (when (and (or icomplete-show-matches-on-no-input
-                       (> (icomplete--field-end) (icomplete--field-beg)))
+                       (if (stringp minibuffer-default)
+                           (/= (icomplete--field-end) (+ (icomplete--field-beg)
+                                                         (length minibuffer-default)))
+                         (> (icomplete--field-end) (icomplete--field-beg))))
                    (or
                     ;; Don't bother with delay after certain number of chars:
                     (> (- (point) (icomplete--field-beg))




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

Previous Next


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