From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: C-r and C-s in minibuffer should search completion Date: Wed, 26 Mar 2008 12:56:02 +0200 Organization: JURTA Message-ID: <87iqz969fh.fsf@jurta.org> References: <87prtiik0l.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206529910 1652 80.91.229.12 (26 Mar 2008 11:11:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Mar 2008 11:11:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 26 12:12:17 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JeTYD-0007u3-12 for ged-emacs-devel@m.gmane.org; Wed, 26 Mar 2008 12:12:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JeTXb-0005IO-Fq for ged-emacs-devel@m.gmane.org; Wed, 26 Mar 2008 07:11:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JeTXW-0005I0-By for emacs-devel@gnu.org; Wed, 26 Mar 2008 07:11:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JeTXU-0005HZ-IZ for emacs-devel@gnu.org; Wed, 26 Mar 2008 07:11:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JeTXU-0005HW-Dj for emacs-devel@gnu.org; Wed, 26 Mar 2008 07:11:28 -0400 Original-Received: from relay03.kiev.sovam.com ([62.64.120.201]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JeTXT-0003Ht-V7 for emacs-devel@gnu.org; Wed, 26 Mar 2008 07:11:28 -0400 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JeTXN-0000es-Nl; Wed, 26 Mar 2008 13:11:24 +0200 In-Reply-To: (Stefan Monnier's message of "Tue, 25 Mar 2008 22:31:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: 565941832c2f675ae953af64aa3a5396 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2455 [Mar 21 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 11 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:93520 Archived-At: >> 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/