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: Sun, 23 Mar 2008 04:17:25 +0200 Organization: JURTA Message-ID: <873aqi2pbe.fsf@jurta.org> References: <87fxul194g.fsf@jurta.org> <87y78dknge.fsf@jurta.org> <874pazefc4.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 1206240187 24570 80.91.229.12 (23 Mar 2008 02:43:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Mar 2008 02:43:07 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 23 03:43:37 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 1JdGBJ-0000gK-IY for ged-emacs-devel@m.gmane.org; Sun, 23 Mar 2008 03:43:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JdGAi-0003xW-UY for ged-emacs-devel@m.gmane.org; Sat, 22 Mar 2008 22:42:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JdGA6-0003iE-P5 for emacs-devel@gnu.org; Sat, 22 Mar 2008 22:42:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JdGA3-0003hE-Tw for emacs-devel@gnu.org; Sat, 22 Mar 2008 22:42:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JdGA3-0003hB-Ll for emacs-devel@gnu.org; Sat, 22 Mar 2008 22:42:15 -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 1JdGA3-0007Pt-6q for emacs-devel@gnu.org; Sat, 22 Mar 2008 22:42:15 -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 1JdG9y-000DPT-Nl; Sun, 23 Mar 2008 04:42:13 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 22 Mar 2008 13:04:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: 4fe2b897d4d72954524b6b73d18f8617 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 2459 [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 [0255], 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:93235 Archived-At: >> However, I agree that putting all buffers pushes this features to the >> extreme because then the list of defaults is the same as the completion >> list. But there is one significant difference: the list of defaults is >> sorted by recency, so switching between several work buffers (more than >> two) is much easier with `C-x b M-n M-n M-n RET'. > > I never said there's no difference. I just think this special case is > not justified. Most likely `C-x b M-p M-p M-p RET' would work just > as well. This assumes that the user prefers C-x b to switch to a new buffer. But it is not the case since more often many other commands switch to a buffer that don't leave a new buffer name in the history list. >> OTOH, searching the completion list would be useful in itself >> independent of searching the history list or the list of defaults >> because often these three are disjoint sets, and the list of defaults >> can be presented even when the completion list is empty. > > If you like it, feel free to customize your Emacs to provide you this > kind of refinement with different commands to search the history, the > list of defaults, and the list of completions. But I think the default > search function bound to M-r/M-s would benefit from searching all > of them. Hmm, now I tend to agree with you that M-s could search the list of completions as well. Since the list of defaults usually is very short, we could search it first and after that search the list of completions. When the list of defaults is not very short then often there is no completions at all, so this should work quite well. The only problem with C-x b is that the buffer list is sorted alphabetically in the list of completions, but it would be much more useful to search them in the order of recency. I see they are sorted in the function `minibuffer-completion-help' as /* Sort and remove duplicates. */ Lisp_Object tmp = completions = Fsort (completions, Qstring_lessp); Maybe we should create a new function `minibuffer-completion-help-unsorted' for C-x b and possibly other commands that might need to keep the original order of elements too? -- Juri Linkov http://www.jurta.org/emacs/