From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrii Kolomoiets Newsgroups: gmane.emacs.bugs Subject: bug#19031: 24.4; find-file in icomplete-mode shows completions with no input Date: Tue, 08 Dec 2020 12:43:21 +0200 Message-ID: References: <864mu464pa.fsf@beta.iola.dk> <87r1o5luz9.fsf@gnus.org> <878sabf6fu.fsf@gnus.org> <87zh2o7krj.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39198"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cc: Ole Laursen , Lars Ingebrigtsen , 19031@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 08 11:44:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmaTd-000A7t-Jk for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Dec 2020 11:44:13 +0100 Original-Received: from localhost ([::1]:55840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmaTc-0001bz-L1 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Dec 2020 05:44:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmaTS-0001aJ-6W for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2020 05:44:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kmaTR-0003Sl-It for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2020 05:44:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kmaTR-0001Em-Hn for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2020 05:44:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrii Kolomoiets Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Dec 2020 10:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19031 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 19031-submit@debbugs.gnu.org id=B19031.16074242124698 (code B ref 19031); Tue, 08 Dec 2020 10:44:01 +0000 Original-Received: (at 19031) by debbugs.gnu.org; 8 Dec 2020 10:43:32 +0000 Original-Received: from localhost ([127.0.0.1]:56667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmaSy-0001Di-Hg for submit@debbugs.gnu.org; Tue, 08 Dec 2020 05:43:32 -0500 Original-Received: from mail-lf1-f43.google.com ([209.85.167.43]:43822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kmaSw-0001DV-3T for 19031@debbugs.gnu.org; Tue, 08 Dec 2020 05:43:30 -0500 Original-Received: by mail-lf1-f43.google.com with SMTP id 23so9319669lfg.10 for <19031@debbugs.gnu.org>; Tue, 08 Dec 2020 02:43:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=H1OrmixvzsSiFbSBMGWsiqDwApPwKkRA29A73qbGd58=; b=G1T+ar9L3k+Y2B+TtyZ1Tf7yRAm6qhJ1OEFW1j+rL0rdSBxhCBjfBBsiu4JK4+ZSY9 YufCZszc4OXvGU4R839OzxHg5XrNuWNRuL24Stzt+EURPaNi5V5Na1wOwUXzvSyIkB4v eVFKMGey8cn+53xFapZsUQ0soaUiLSuKmI1JSmkQLlneaSKVP1qOTgu7siHC7aLs065g TlTE6Or6yC5Xr56nEotP/QXc1FegORjSbijr9YbR4ANhYODDYilVjP+rfAppvGC/YjsH MJEBQYijKWq3olYcvBzdzUV0j6UghtG/pKUuhhKpmCx8SSkVGKF0OrXz4T0i+OBn3jd3 aSSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=H1OrmixvzsSiFbSBMGWsiqDwApPwKkRA29A73qbGd58=; b=muEm+DiGbrZK1wVnilskwo4n7ZDjmZcFEMFyRLv7zRWD3RtDDk/RQPRWevex2sOOP0 AMcJ7qEoRiw1+GSLymvKAJWKM/D0sRIMKlcOuQaaX+DlwclTUvALzuu269NMPqvNzxje a22kRXv9w0uNKLR0TNz+5VWCS2YPd3i7+mV+PnpDFlZNJlh6236WOjDEBYFa8rSi0pRG U5rv4FfB6Rx5AZyl5eCF71DCUtFfrpvjN764F9AQY8L+I8e69+dAQ3HB3BDVG/0Vk+6H izg2rnexHq6ub4YdtopTy4Ebqhr8sSv/8Xoteb4uRA4YI2WlYjlO6e9CAYKBsPMr+yLA 4LwA== X-Gm-Message-State: AOAM530Obh2fzJivnLFl8L01mgwWV6Zr66PF7REyJqT02ly57NroqO96 j8k6E++vi2A8rEBN2uWIbqUQb9hLvAI= X-Google-Smtp-Source: ABdhPJyh3HogQISHq4QXat8bjDezB9/zm7QQMVY3+bHVQkkGieEnHkmKqjV8Ogdmz8tflR4C4H1d5Q== X-Received: by 2002:a19:7b16:: with SMTP id w22mr93670lfc.657.1607424203555; Tue, 08 Dec 2020 02:43:23 -0800 (PST) Original-Received: from muffinmac ([91.206.110.206]) by smtp.gmail.com with ESMTPSA id z20sm3344280ljm.138.2020.12.08.02.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 02:43:22 -0800 (PST) In-Reply-To: <87zh2o7krj.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 08 Dec 2020 10:51:04 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:195321 Archived-At: Juri Linkov writes: >> 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. 1. emacs -Q 2. M-: (setq insert-default-directory nil) 3. M-x icomplete-mode 4. C-x C-f ~/ In this case everything works as described by the docstring: user input is here so completions are shown. But IMO Ole's issue is not completely solved: bunch of uninteresting dotfiles are shown. I was thinking about some method wich will allow to tell that minibuffer is empty even if there are some user input. From your patch I learned about the 'minibuffer-default' variable and looks like it can be the method I was thinking of. If the 'read-file-name-default' function can set the 'minibuffer-default' variable to the substring of the minibuffer content from (minibuffer-prompt-end) to the last occurence of the path separator, then, in addition to the patched 'icomplete-exhibit', this can give desired result: no completions will be show until some input after path separator. WDYT?