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: Stefan Monnier
Subject: Re: C-r and C-s in minibuffer should search completion
Date: Tue, 25 Mar 2008 22:31:15 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> I believe C-s and C-r in the minibuffer should not only search the
>> history but the completion table as well (at least when it's not
>> a function).
>> 
>> Could someone implement this feature?

> 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.
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.

> + (defun minibuffer-default-add-completions ()
> +   "Return a list of all completions without the default value.
> + This function is used to add all elements of the completion table to
> + the end of the list of defaults after the default value."
> +   (interactive)
> +   (let ((def minibuffer-default)
> +     (all (all-completions ""
> +                           minibuffer-completion-table
> +                           minibuffer-completion-predicate
> +                           t)))
> +     (if (listp def)
> +     (append def all)
> +       (setq all (cons def (delete def all))))))

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.

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.


        Stefan




reply via email to

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