From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: C-r and C-s in minibuffer should search completion Date: Sun, 30 Mar 2008 18:41:39 -0400 Message-ID: References: <87prtiik0l.fsf@jurta.org> <87iqz969fh.fsf@jurta.org> <87od9181m7.fsf@jurta.org> <87lk440z31.fsf@jurta.org> <87od8xccz6.fsf@jurta.org> <87hceouksk.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 1206916997 5096 80.91.229.12 (30 Mar 2008 22:43:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 22:43:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 31 00:43:48 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 1Jg6Ff-0005kk-GU for ged-emacs-devel@m.gmane.org; Mon, 31 Mar 2008 00:43:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg6F3-0008PY-Lx for ged-emacs-devel@m.gmane.org; Sun, 30 Mar 2008 18:43:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jg6De-0007s1-Pb for emacs-devel@gnu.org; Sun, 30 Mar 2008 18:41:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jg6Dd-0007rB-3i for emacs-devel@gnu.org; Sun, 30 Mar 2008 18:41:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg6Dd-0007r5-05 for emacs-devel@gnu.org; Sun, 30 Mar 2008 18:41:41 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jg6Dc-0002RC-RQ for emacs-devel@gnu.org; Sun, 30 Mar 2008 18:41:40 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AisFALWz70fO+LLN/2dsb2JhbACBWqVS X-IronPort-AV: E=Sophos;i="4.25,579,1199682000"; d="scan'208";a="17177465" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 30 Mar 2008 18:41:40 -0400 Original-Received: from pastel.home ([206.248.178.205]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id KZT34340; Sun, 30 Mar 2008 18:41:40 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id E66F77FDF; Sun, 30 Mar 2008 18:41:39 -0400 (EDT) In-Reply-To: <87hceouksk.fsf@jurta.org> (Juri Linkov's message of "Sun, 30 Mar 2008 21:32:19 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:93974 Archived-At: >>> However, there is one problem now: `C-x b M-n M-n' puts in the minibuffer >>> the name of the current buffer because the current buffer is in the front >>> of the buffer list acquired from the completion table in read-buffer. >> >> This is a very minor problem. > This is a usability problem for users who will prefer using `C-x b M-n M-n' > to switch buffers by recency. And the current buffer will be annoying > in this list. Again, a very minor problem. >>> But it makes no sense to switch to the current buffer, so the case 'B' >> >> Then switch-to-buffer should use a completion predicate that rules out >> the current-buffer. And the history functions should pay attention to it. > The completion list still should contain the current buffer for other > commands that read a buffer name and whose semantics may require > the presence of the current buffer in the completion list. Is that supposed to disagree with what I wrote? > Since removing the current buffer from the list of defaults is necessary > only for three commands `C-x b', `C-x 4 b' and `C-x 5 b', I propose just > to check for their names before removing the current buffer from the list: No, this is the wrong way to go about it. The special code should be in C-x b, C-x 4 b, and C-x 5 b. Checking the caller inside the minibuffer is *bad*. I already suggested a much better solution: use a minibuffer-completion-predicate. That's what it's for. Stefan