* bug#43774: 27.1; fido-mode completion don't accept empty string nor matching substring
@ 2020-10-03 6:30 Teemu Likonen
2020-10-04 7:18 ` Protesilaos Stavrou
0 siblings, 1 reply; 5+ messages in thread
From: Teemu Likonen @ 2020-10-03 6:30 UTC (permalink / raw)
To: 43774
[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test.org --]
[-- Type: text/x-org, Size: 234 bytes --]
* first :one:
* second :two:
* third :three:
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#43774: 27.1; fido-mode completion don't accept empty string nor matching substring
2020-10-03 6:30 bug#43774: 27.1; fido-mode completion don't accept empty string nor matching substring Teemu Likonen
@ 2020-10-04 7:18 ` Protesilaos Stavrou
2020-10-04 8:24 ` Teemu Likonen
0 siblings, 1 reply; 5+ messages in thread
From: Protesilaos Stavrou @ 2020-10-04 7:18 UTC (permalink / raw)
To: Teemu Likonen; +Cc: 43774
On 2020-10-03, 09:30 +0300, Teemu Likonen <tlikonen@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
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#43774: 27.1; fido-mode completion don't accept empty string nor matching substring
2020-10-04 7:18 ` Protesilaos Stavrou
@ 2020-10-04 8:24 ` Teemu Likonen
2021-06-06 11:09 ` Lars Ingebrigtsen
2021-06-06 12:15 ` Dmitry Gutov
0 siblings, 2 replies; 5+ messages in thread
From: Teemu Likonen @ 2020-10-04 8:24 UTC (permalink / raw)
To: Protesilaos Stavrou; +Cc: 43774
[-- Attachment #1: Type: text/plain, Size: 870 bytes --]
* 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#43774: 27.1; fido-mode completion don't accept empty string nor matching substring
2020-10-04 8:24 ` Teemu Likonen
@ 2021-06-06 11:09 ` Lars Ingebrigtsen
2021-06-06 12:15 ` Dmitry Gutov
1 sibling, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2021-06-06 11:09 UTC (permalink / raw)
To: Teemu Likonen; +Cc: 43774, Protesilaos Stavrou
Teemu Likonen <tlikonen@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
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#43774: 27.1; fido-mode completion don't accept empty string nor matching substring
2020-10-04 8:24 ` Teemu Likonen
2021-06-06 11:09 ` Lars Ingebrigtsen
@ 2021-06-06 12:15 ` Dmitry Gutov
1 sibling, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2021-06-06 12:15 UTC (permalink / raw)
To: Teemu Likonen, Protesilaos Stavrou; +Cc: 43774
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?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-06 12:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-03 6:30 bug#43774: 27.1; fido-mode completion don't accept empty string nor matching substring Teemu Likonen
2020-10-04 7:18 ` Protesilaos Stavrou
2020-10-04 8:24 ` Teemu Likonen
2021-06-06 11:09 ` Lars Ingebrigtsen
2021-06-06 12:15 ` Dmitry Gutov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.