emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C-r and C-s in minibuffer should search completion


From: Juri Linkov
Subject: Re: C-r and C-s in minibuffer should search completion
Date: Wed, 26 Mar 2008 12:56:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

>> I now have an idea how to implement this feature.
>
>> Some time ago I submitted a patch that introduces a new variable
>> `minibuffer-default-set-function' that extends a list of defaults
>> when minibuffer position hits the bottom of the list of defaults.
>
> How would that help?  M-r/M-s doesn't seem to search minibuffer-default.

It would be trivial to add in `previous-matching-history-element' the
same extending a list of defaults with a list of completions when M-s
hits the bottom of the list.

> But I guess it does help with C-s, which is what I mistyped.
> Actually, now that I take a closer look.  Why do we have both C-s/C-r
> and M-r/M-s?  They seem redundant.

As everywhere in normal modes there are two search types: incremental
and non-incremental, in the minibuffer C-s/C-r provides incremental
search, and M-r/M-s - non-incremental.

In normal modes non-incremental search is provided by `C-s RET'
but in the minibuffer it displays a different prompt ("Search: ")
than M-s "Next element matching (regexp): ".

Also M-s is a backward-compatible keybinding for users that already
use it for many years.

> This is not good when the completion table is a function that takes
> a long time, because then you have to wait for the completion table to
> be built before you can get the actual real DEF.

Just as when the user needs to see a full list of completions, the user
can bear a long time to built the completion table, when the user needs
to search a full list of completions, it is exactly the same situation: the
user have to wait when the user wants to search the completion list
(though I don't know where in Emacs building the completion table takes
too long time, even C-h f takes less than 1 sec on modern hardware, and
woman takes 2 sec to build her very large completion table but does before
displaying the minibuffer.)

> Better would be to call the function only after we consumed
> minibuffer-default.  Or maybe only do it when the completion-table is
> not a function.

It now calls the function after moved below minibuffer-default so it seems
this is good, and also it seems good to build the completion-table even
from a function because I think it is not a problem to wait a few seconds
if there is a need to search the completion-table built from a function.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]