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: Wed, 24 Aug 2011 18:44:19 +0300 Organization: JURTA Message-ID: <87ei0aizl8.fsf@mail.jurta.org> References: <87livig3cr.fsf@mail.jurta.org> <87r55aenuc.fsf@mail.jurta.org> <87oc0c176d.fsf@mail.jurta.org> <87fwkuppz3.fsf@mail.jurta.org> <8739gtg0wp.fsf@mail.jurta.org> <87liukxxtj.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1314201100 11802 80.91.229.12 (24 Aug 2011 15:51:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 24 Aug 2011 15:51:40 +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 Wed Aug 24 17:51:34 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 1QwFjp-0006qF-92 for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Aug 2011 17:51:33 +0200 Original-Received: from localhost ([::1]:44829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwFjo-0001Xa-Jj for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Aug 2011 11:51:32 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwFjl-0001Uo-KB for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2011 11:51:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwFjk-0004W7-LQ for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2011 11:51:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39179) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwFjk-0004W3-Ic for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2011 11:51:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QwFmE-0006bD-5L; Wed, 24 Aug 2011 11:54: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: Wed, 24 Aug 2011 15:54: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.131420123325352 (code B ref 9185); Wed, 24 Aug 2011 15:54:02 +0000 Original-Received: (at 9185) by debbugs.gnu.org; 24 Aug 2011 15:53:53 +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 1QwFm3-0006an-Os for submit@debbugs.gnu.org; Wed, 24 Aug 2011 11:53:53 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwFm2-0006aX-3h for 9185@debbugs.gnu.org; Wed, 24 Aug 2011 11:53:50 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id EB2546E805A; Wed, 24 Aug 2011 08:51:12 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id B7A4C451C28D; Wed, 24 Aug 2011 08:51:11 -0700 (PDT) In-Reply-To: (Dani Moncayo's message of "Wed, 24 Aug 2011 16:23:24 +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: Wed, 24 Aug 2011 11:54: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:50286 Archived-At: > But I've found another use-case that seems to need a fix too: > 0. C-s a C-s b C-s c > 1. C-s C-s --> "c" is selected, OK. > 2. M-p --> "b" is selected, OK. > 3. M-p --> Now "c" (the previous used entry) should have been > selected, but I see that "b" (the current entry) remains selected > instead. This is a separate problem caused when exiting from the minibuffer in `isearch-edit-string' by `read-from-minibuffer' (i.e. step 2 `M-p ' above) adds a new element "b" to the history (search ring). I agree that `isearch-edit-string' should not update the search ring. It should be updated only by `isearch-update-ring' in `isearch-done'. So e.g. `C-s C-s M-e RET C-g' or `C-s M-p RET C-g' should keep the search ring unchanged. Note also that `isearch-done' with the arg NOPUSH=t already tries to take care of not updating the search ring, but unsuccessfully. It requires the following patch for the complete fix: Using parent branch file:///home/work/emacs/bzr/emacs/http-trunk/ === modified file 'lisp/isearch.el' --- lisp/isearch.el 2011-07-15 13:33:07 +0000 +++ lisp/isearch.el 2011-08-24 15:43:01 +0000 @@ -1152,9 +1161,14 @@ (defun isearch-edit-string () (unwind-protect (let* ((message-log-max nil) + ;; Protect the global search ring from updating + ;; by read-from-minibuffer. It should be updated only + ;; by isearch-update-ring in isearch-done. + (search-ring search-ring) + (regexp-search-ring regexp-search-ring) ;; Binding minibuffer-history-symbol to nil is a work-around ;; for some incompatibility with gmhist. (minibuffer-history-symbol)) (setq isearch-new-string (read-from-minibuffer (isearch-message-prefix nil nil isearch-nonincremental) (cons isearch-string (1+ (isearch-fail-pos))) minibuffer-local-isearch-map nil (if isearch-regexp (cons 'regexp-search-ring