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: First two elements of search-ring shown twice in minibuffer when using M-p multiple times? Date: Mon, 10 Mar 2008 20:28:36 +0200 Organization: JURTA Message-ID: <87tzjewi0b.fsf@jurta.org> References: <87myp99rd3.fsf@jurta.org> <87od9n36ew.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 1205174308 6527 80.91.229.12 (10 Mar 2008 18:38:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Mar 2008 18:38:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tobias Bading Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 10 19:38:55 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 1JYmsu-0002ZR-2z for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 19:38:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYmsL-0002fh-Sr for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 14:37:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYmsI-0002f8-A1 for emacs-devel@gnu.org; Mon, 10 Mar 2008 14:37:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYmsG-0002eQ-1Q for emacs-devel@gnu.org; Mon, 10 Mar 2008 14:37:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYmsF-0002eN-S7 for emacs-devel@gnu.org; Mon, 10 Mar 2008 14:37:23 -0400 Original-Received: from relay01.kiev.sovam.com ([62.64.120.200]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JYmsF-0005mE-Gh for emacs-devel@gnu.org; Mon, 10 Mar 2008 14:37:23 -0400 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JYms5-0007n0-IL; Mon, 10 Mar 2008 20:37:21 +0200 In-Reply-To: <87od9n36ew.fsf@jurta.org> (Juri Linkov's message of "Sun, 09 Mar 2008 23:59:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu) X-Scanner-Signature: 88f972a75cd389d721acc69b695bb680 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 2374 [Mar 9 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 4.8-5.1 (or MacOS X 10.2-10.3) 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:92083 Archived-At: > Below is a patch that fixes all these problems. It uses > search-ring-yank-pointer and regexp-search-ring-yank-pointer > for the HISTPOS argument of read-from-minibuffer that gives > the correct initial minibuffer search history position for > isearch-edit-string. I noticed that this change also fixed `C-s M-n M-n ...' to work correctly, i.e. to start with the last element of the search ring and advance down to the first element of the search ring in the minibuffer. But I see one inconvenience in using M-p. It is intended to retrieve the previous search string from the search ring. So when the ring is '("3" "2" "1"), `C-s M-p' could retrieve "3". I suppose it currently retrieves "2" because there exists another convenient key sequence `C-s C-s' to retrieve the last search string "3"? However, when the current search string is not the same as the last search string in the search ring, it seems more natural to expect M-p to retrieve the last search string "3", i.e. what `C-s 4 M-p' should retrieve: "3" or "2", I'm not sure. -- Juri Linkov http://www.jurta.org/emacs/