From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#9185: 24.0.50; "C-s M-p" does not bring the tip of the search ring Date: Thu, 25 Aug 2011 12:01:51 +0300 Organization: JURTA Message-ID: <87aaaxq35c.fsf@mail.jurta.org> References: <87oc0c176d.fsf@mail.jurta.org> <87fwkuppz3.fsf@mail.jurta.org> <8739gtg0wp.fsf@mail.jurta.org> <87liukxxtj.fsf@mail.jurta.org> <87ei0aizl8.fsf@mail.jurta.org> <878vqid5qe.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1314263015 12599 80.91.229.12 (25 Aug 2011 09:03:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2011 09:03:35 +0000 (UTC) Cc: 9185@debbugs.gnu.org To: Dani Moncayo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 25 11:03:31 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QwVqT-0006Po-7h for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 11:03:29 +0200 Original-Received: from localhost ([::1]:55118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwVqS-0003kh-O8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 05:03:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwVqP-0003jg-UM for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2011 05:03:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwVqO-0007NI-MX for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2011 05:03:25 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwVqO-0007NE-J4 for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2011 05:03:24 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QwVsw-0001G5-6Z; Thu, 25 Aug 2011 05:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Aug 2011 09:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9185 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9185-submit@debbugs.gnu.org id=B9185.13142631444811 (code B ref 9185); Thu, 25 Aug 2011 09:06:02 +0000 Original-Received: (at 9185) by debbugs.gnu.org; 25 Aug 2011 09:05:44 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwVsd-0001FX-Jt for submit@debbugs.gnu.org; Thu, 25 Aug 2011 05:05:43 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwVsa-0001FP-Ae for 9185@debbugs.gnu.org; Thu, 25 Aug 2011 05:05:41 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 70DEB6E80AC; Thu, 25 Aug 2011 02:03:01 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 307B6451C28D; Thu, 25 Aug 2011 02:02:59 -0700 (PDT) In-Reply-To: (Dani Moncayo's message of "Thu, 25 Aug 2011 01:54:39 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 25 Aug 2011 05:06:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50328 Archived-At: > 0. C-s a C-s b C-s c > 1. C-s M-e --> "c" is selected, OK [*]. > 2. M-p --> Now "b" (the previous entry) should have been > selected, but I see that "c" (the current entry) remains selected > instead. This can be easily fixed by moving `isearch-ring-adjust1' out of let-binding of `search-ring-yank-pointer'. But I think we should start from the top of the search ring after `M-e RET' because we can't reliably update the index. See more below. > [*] FWIW: This is indeed the current behavior (use the last entry if > the minibuffer is empty), but I don't find it very suitable. If the > user wanted to use the last entry, s?he would have typed M-p. > Therefore, IMO TRT here would be to return to Isearch with an empty > string. I suppose the last entry is used because otherwise an empty search string makes no sense. I have nothing against this functionality because I never exit from the M-e minibuffer with empty input. > Another failing use-case: > 0. C-s a C-s b C-s c C-s d > 1. C-s C-s =A0 =A0 --> "d" is selected (ok). > 2. M-p M-p =A0--> "b" is selected (ok). > 3. M-p --> "a" should have been selected, but I see that > "b" remains selected instead. We can't reliably count the number of typed M-p in `read-from-minibuffer' in `isearch-edit-string' to adjust the index accordingly and to add the same number of typed M-p to the index. There is no reliable way to do th= is: we could try to find the input string in the history (search ring) and add its index to `search-ring-yank-pointer', but what to do when the user types the same string that exists in the history - then the index in the search ring will be incorrect. Since `read-from-minibuffer' can't return the exact number of typed `M-p' then I think that M-p after `M-e M-p M-p ' should start from the top of of the search ring, so `C-s C-s M-p M-p RET M-p' should select "d"= . This will provide a predictable result. OTOH, when `search-ring-update' is non-nil, `isearch-edit-string' is not = used, so everything works correctly.