GNU bug report logs - #43774
27.1; fido-mode completion don't accept empty string nor matching substring

Previous Next

Package: emacs;

Reported by: Teemu Likonen <tlikonen <at> iki.fi>

Date: Sat, 3 Oct 2020 06:32:02 UTC

Severity: normal

Tags: confirmed

Found in version 27.1

To reply to this bug, email your comments to 43774 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#43774; Package emacs. (Sat, 03 Oct 2020 06:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Teemu Likonen <tlikonen <at> iki.fi>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 03 Oct 2020 06:32:02 GMT) Full text and rfc822 format available.

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

From: Teemu Likonen <tlikonen <at> iki.fi>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; fido-mode completion don't accept empty string nor matching
 substring
Date: Sat, 03 Oct 2020 09:30:42 +0300
[Message part 1 (text/plain, inline)]
Emacs fido-mode (which is part of icomplete-mode) implements minibuffer
completion system which offers quick and easy way to choose one of the
available options. However, sometimes user needs to enter a different
substring which is not any of the available options. Sometimes even
empty string is needed. This seems to be impossible in fido-mode. The
following example demonstrates the empty string problem.

 1. Save the attached (inline) file "test.org".

 2. Start Emacs and open the file:

    emacs -Q test.org

 3. Ensure that the major mode is org-mode and turn on fido-mode:

    M-x org-mode
    M-x fido-mode

 4. Press "C-c C-c" (org-ctrl-c-ctrl-c) on any of the Org heading lines.
    The command will start editing tags for the current heading line.
    The available tags in the buffer are :one:, :two:, :three:.

 5. Try to clear the prompt from any tags. This works but it seems to be
    impossible to actually enter empty string because one of the
    buffer's present tags are always chosen when user finishes the
    prompt with RET key.

A work-around in org-mode's tag completion prompt is to enter one colon
(:) in the prompt but this is not general solution to the empty string
problem.

Another difficulty comes with entering just a substring of available
matches. The following example demonstrates this.

 1. Start Emacs with "emacs -Q".

 2. Turn fido-mode on.

    M-x fido-mode

 3. Press "C-x b" (switch-to-buffer) and try to create buffer named
    "scr" which is a substring of "*scratch*" buffer. This seems to be
    impossible or there is no documented way to do this.


-- 
/// Teemu Likonen - .-.. http://www.iki.fi/tlikonen/
// OpenPGP: 4E1055DC84E9DFF613D78557719D69D324539450
[test.org (text/x-org, inline)]
* first                                                                 :one:
* second                                                                :two:
* third                                                               :three:

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43774; Package emacs. (Sun, 04 Oct 2020 07:19:01 GMT) Full text and rfc822 format available.

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

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: Teemu Likonen <tlikonen <at> iki.fi>
Cc: 43774 <at> debbugs.gnu.org
Subject: Re: bug#43774: 27.1; fido-mode completion don't accept empty string
 nor matching substring
Date: Sun, 04 Oct 2020 10:18:34 +0300
On 2020-10-03, 09:30 +0300, Teemu Likonen <tlikonen <at> iki.fi> wrote:

> Emacs fido-mode (which is part of icomplete-mode) implements minibuffer
> completion system which offers quick and easy way to choose one of the
> available options. However, sometimes user needs to enter a different
> substring which is not any of the available options. Sometimes even
> empty string is needed. This seems to be impossible in fido-mode. The
> following example demonstrates the empty string problem.
>
> [..]

Hi Teemu,

Try to use C-j (icomplete-force-complete-and-exit) to insert a substring
that is not part of the list of candidates.

A simple reproducible recipe (I am on Emacs 28.0.50):

+ Start 'emacs -Q'

+ In the scratch buffer first evaluate:

  (fido-mode 1)

+ Then evaluate:

  (insert
   (completing-read "Test arbitrary input: " '(one two three)))

+ Instead of selecting among {one,two,three} you can type any string,
  such as "test" and add it with C-j.  Your input shall be inserted at
  point.

This should work for a substring, but I am not sure it does for an empty
string.

-- 
Protesilaos Stavrou
protesilaos.com




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43774; Package emacs. (Sun, 04 Oct 2020 08:25:02 GMT) Full text and rfc822 format available.

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

From: Teemu Likonen <tlikonen <at> iki.fi>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: 43774 <at> debbugs.gnu.org
Subject: Re: bug#43774: 27.1; fido-mode completion don't accept empty string
 nor matching substring
Date: Sun, 04 Oct 2020 11:24:41 +0300
[Message part 1 (text/plain, inline)]
* 2020-10-04 10:18:34+03, Protesilaos Stavrou wrote:

> Try to use C-j (icomplete-force-complete-and-exit) to insert a
> substring that is not part of the list of candidates.

It doesn't work with my test cases. C-j in fido-mode selects the current
option, not the typed (sub)string.

I have switched to plain icomplete-mode. It is quite close to fido-mode
when used with these settings:

    (setq completion-styles '(flex)
          read-file-name-completion-ignore-case t
          read-buffer-completion-ignore-case t)

Plain icomplete-mode has a way to choose only the typed string (RET), a
way to choose the suggested option and exit (C-j), and a way to complete
the string to the suggested option (C-M-i), plus some other things.

-- 
/// Teemu Likonen - .-.. http://www.iki.fi/tlikonen/
// OpenPGP: 4E1055DC84E9DFF613D78557719D69D324539450
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43774; Package emacs. (Sun, 06 Jun 2021 11:10:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Teemu Likonen <tlikonen <at> iki.fi>
Cc: 43774 <at> debbugs.gnu.org, Protesilaos Stavrou <info <at> protesilaos.com>
Subject: Re: bug#43774: 27.1; fido-mode completion don't accept empty string
 nor matching substring
Date: Sun, 06 Jun 2021 13:09:09 +0200
Teemu Likonen <tlikonen <at> iki.fi> writes:

> * 2020-10-04 10:18:34+03, Protesilaos Stavrou wrote:
>
>> Try to use C-j (icomplete-force-complete-and-exit) to insert a
>> substring that is not part of the list of candidates.
>
> It doesn't work with my test cases. C-j in fido-mode selects the current
> option, not the typed (sub)string.

Yes, there seems to be no way to select the empty string in fido-mode
with C-j, as far as I can tell (with your test case).

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




Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Jun 2021 11:10:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43774; Package emacs. (Sun, 06 Jun 2021 12:16:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Teemu Likonen <tlikonen <at> iki.fi>, Protesilaos Stavrou <info <at> protesilaos.com>
Cc: 43774 <at> debbugs.gnu.org
Subject: Re: bug#43774: 27.1; fido-mode completion don't accept empty string
 nor matching substring
Date: Sun, 6 Jun 2021 15:15:07 +0300
On 04.10.2020 11:24, Teemu Likonen wrote:
> Plain icomplete-mode has a way to choose only the typed string (RET), a
> way to choose the suggested option and exit (C-j), and a way to complete
> the string to the suggested option (C-M-i), plus some other things.

Have you tried 'M-j' in fido-mode?




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

Previous Next


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